Can JavaScript detect the Arc browser?

1.1k Views Asked by At

The Arc browser is a new browser which used the Chromium engine and identifies itself as Chrome using a user agent string like this: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Can JavaScript tell the difference between Arc and Chrome/Chromium? There must be something different about it.

1

There are 1 best solutions below

0
Liam On BEST ANSWER

There is an Arc-specific CSS variable --arc-palette-title that you can check for:

console.log(
    getComputedStyle(document.documentElement)
    .getPropertyValue('--arc-palette-title') ? 'Is Arc' : 'Is Not Arc'
);

Note: does not work while page is still loading.