javascriptgoogle-chromechromiumuser-agent

How to distinguish chrome from chromium using javascript?


Problem:

Chrome has alternative methods for extensions' installation, but chromium doesn't. So for my product, which consist of web extension and some application on host machine, I need to show different instructions to user after installation. This instruction is opened in default browser so it's one page with script inside, that create different page content for different browsers.

What I want:

I wanted to use userAgent to distinguish chrome from pure chromium, but now as I see, they both have the same userAgent and userAgentData. So is there any ways to find out if this is chrome or chromium?

UPD:

they both have the same userAgent and userAgentData.

and this is not true... =/


Solution

  • You can use navigator.userAgentData.brands. On Chrome, it will include "Google Chrome".