2

A fairly big site is somehow detecting I am using Chrome Canary (Google Chrome's early-releases browser). I have tried several user-agent switchers, but somehow they still keep knowing I am using Canary.

I have tried user-agent detection, but that is definitely not a good way to check which browser someone uses. I have also tried this: https://stackoverflow.com/a/9851769/2098652 but it cannot tell the difference between regular Chrome and Chrome Canary.

!!window.chrome && !!window.chrome.webstore

This will tell if I am using Chrome, basically. However, there is no such object as window.canary or window.chromeCanary or anything like that.

Question is: How do I efficiently check, if someone is using Google Chrome Canary?

Community
  • 1
  • 1
MortenMoulder
  • 6,138
  • 11
  • 60
  • 116
  • 1
    Why do you need to check that? – nils Mar 10 '16 at 12:54
  • @nils For a project I am doing. I can't disclose more information about it though. – MortenMoulder Mar 10 '16 at 12:54
  • Do you need to know this for browser statistic or do you want to change the behaviour of the site because of it? – nils Mar 10 '16 at 12:56
  • @nils For the purpose of the website. Why does it really matter what I am going to use it for? – MortenMoulder Mar 10 '16 at 12:56
  • Did you try disabling flash/java? Just guessing... not sure if "Chrome Canary" has those though. – Gogol Mar 10 '16 at 13:03
  • @noc2spamツ Canary has everything the regular Chrome has. It just has the newer updates, that gets pushed to Canary before Chrome. I did try disabling both and nothing worked. – MortenMoulder Mar 10 '16 at 13:04
  • Strange! Also, could you try disabling all the plugins you have (although I don't think that's how they are detecting it. ) ? – Gogol Mar 10 '16 at 13:06
  • @noc2spamツ I tried in incognito mode, which has all my extensions disabled, and they are still detecting it. They told me on Twitter, that Canary is not supported on their site. Which is true, because all content is black, but only in Canary! All their Javascript is highly obfuscated, but I haven't been able to find anything. – MortenMoulder Mar 10 '16 at 13:11
  • "Why does it really matter what I am going to use it for?" Because that information should not matter. What in your mind makes an outdated Chrome Canary different than the same-version Stable with all the flags to make it the same as Canary? What should matter are the features available, that's what one should test for. – Kaiido Dec 05 '22 at 02:35

2 Answers2

0

Like you mentioned, Chrome Canary is just Chrome but with newer features. Ideally, it behaves just like Chrome (but with said newer features) otherwise that'd be a problem once they roll those changes into the release version of Chrome.

The easiest way to check if someone is using Chrome Canary would be to find a new feature (that only exists in canary) and try to use it.

try {
    useNewFeature();
    console.log('Canary!')
catch() {
    console.log('Not Canary');
}

If it works, they're using canary! However, you will have to update this and find a new feature to check for any time Chrome is updated.

jkrei0
  • 188
  • 1
  • 9
0

This is a primitive method to detect if the user is using a beta version of a chromium based browser. Unfortunately, you will have to update the variable "latestChrome" everytime chrome gets an update.

const latestChrome = 111.1; //latest stable chrome version
const currentChrome = Number(window.navigator.userAgentData.brands[0].version)
    if(navigator.userAgent.includes("Chrome"){
     if(currentChrome > latestChrome){
        alert("chrome canary or brave beta");
    
           }
    }