Search code examples
google-chromeuser-agentdetectionchromium

How do I detect Chromium specifically vs. Chrome?


Is there a way to detect if a visitor to my site is running Chromium as opposed to Google Chrome? Even basic UA sniffing (which I know is bad practice) would suffice for my particular case, but it appears that Chromium and Chrome share the same UA string – is that correct? Is there any other way that I can differentiate between the two?


Solution

  • Chrome ships with a built-in PDF reader, Chromium doesn't.
    You could detect this by using JavaScript:

    function isChrome() { // Actually, isWithChromePDFReader
        for (var i=0; i<navigator.plugins.length; i++)
            if (navigator.plugins[i].name == 'Chrome PDF Viewer') return true;
        return false;
    }
    

    This method is not 100% reliable, because users can copy the PDF reader binary from Chrome to their Chromium directory, see this answer on Ask Ubuntu.

    There's almost no difference between Chromium and Chrome (certainly not in the rendering or JavaScript engine), so why do you want to spot the difference?