I have a Chrome extension, and I am currently writing a website to advertise it. I know that a Chrome extension can be installed in all Chromium-based browsers (Chrome, Opera, etc.).
Is it possible to check if a browser can download the extension from the web store or is chromium-based?
I found code to detect if it was Google Chrome here. Correct me if I'm wrong, but I think window.chrome
doesn't return in all Chromium-based browsers.
Microsoft Edge, Samsung Internet, Opera, and many other browsers are based on the Chromium code. Moreover, significant portions of the code are used by several app frameworks.
To check this, launch Microsoft Edge and press the JAWS keystroke INSERT+Q to see what JAWS settings are currently loaded. If you are running JAWS 2020 or later and you receive the message “Microsoft Edge with Chromium settings are loaded,” then you are running the latest version of Edge.
The most commonly used methods for chromium detection in water are laboratory-based methods, such as atomic absorption spectroscopy and mass spectroscopy. Although these methods are highly selective and sensitive, they require expensive maintenance and highly trained staff.
As of now, window.chrome
works in all chromium based browsers
var isChromium = !!window.chrome;
console.log(isChromium)
Resources
User-Agent Client Hints
API returns information about the browser and operating system of a user. (Introduced in chrome 90)
var isChromium = !!navigator.userAgentData && navigator.userAgentData.brands.some(data => data.brand == 'Chromium');
console.log(isChromium)
Resources
Considering that you just want to get to know whether browser is chromium based or not ,
Method 1: ( Server Side Detection)
-- Get Browser name from client request itself and serving the webpage accordingly. For example, If backend is based on Nodejs, You can get browser name as answered in this answer.
Method 2: ( Client Side Detection)
-- On client Side ,You can first get the Browser Name as answered in this answer , and then check it from HARD-CODED Chromium-based browsers Array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With