2

I would like to know if many visitors to my sites are using the Arc browser.

It uses a Chrome user agent string: 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

Google Analytics does not report any visits from this browser, even when I look at a report that includes millions of users.

When I use Arc and do a Google search for "what is my browser", all of the tools that I find report that I am using Chrome 112.

If this is the same for many Chrome or Chromium based browsers, I wonder how many of them are reported incorrectly by Google Analytics...

So my question: Is there any way, server-side or client-side, to detect if the browser is Arc?

1 Answer 1

4

Yes! By checking for an Arc-specific CSS variable.

Arc enables us to style a website to match the color palette of the browser UI, by providing us with CSS variables such as --arc-palette-background. Apparently these CSS variables are not available as the page is loading, but are added a little later. Checking for it ion page load consistently fails, but using setTimeout to check it a second later works.

We can check if this CSS variable has been set with this JavaScript code:

    window.addEventListener("load", function() {
        setTimeout(function(){
            console.log('1 second after window load: ', getComputedStyle(document.documentElement).getPropertyValue('--arc-palette-background') ? 'Yes' : 'No');
        }, 1000);
    });

This is the only way I have found that allows developers to detect if a user is using Arc.

1
  • You could use this to set up tracking of this information to Google Analytics, for example.
    – Liam
    Commented May 1, 2023 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.