Skip to content

Commit

Permalink
Improve browser detection (#134)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <[email protected]>
  • Loading branch information
Richienb and sindresorhus authored Mar 28, 2022
1 parent 4f459ee commit bb40ba8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-env browser */

const isBlinkBasedBrowser = /\b(Chrome|Chromium)\//.test(navigator.userAgent);
const isBlinkBasedBrowser = navigator.userAgentData
? navigator.userAgentData.brands.some(({brand}) => brand === 'Chromium')
: /\b(Chrome|Chromium)\//.test(navigator.userAgent);

const colorSupport = isBlinkBasedBrowser ? {
level: 1,
Expand Down

0 comments on commit bb40ba8

Please sign in to comment.