Is it possible to detect via JS what extensions / add ons a user has installed on his browser? The use case was the a particular chrome extension, Autofill was setting some text values into hidden zip fields causing some validations to fail and I want to show a message to the user that this extension might create problems.
-
You cannot control how a user configures their browser from Javascript. That would be a gaping security hole. Firefox add-ons have the option of being web accessible (detectible) or not, but that is completely up to the add-on developer (meaning malicious add-ons are obviously going to choose to stay hidden). I suspect it is similar for Chrome extensions. – user2867288 Mar 07 '14 at 15:48
-
Add-on detection in Chrome: http://blog.kotowicz.net/2012/02/intro-to-chrome-addons-hacking.html – user423430 Jan 05 '17 at 16:56
-
Does this answer your question? [Check if user has a third party Chrome extension installed](https://stackoverflow.com/questions/39897925/check-if-user-has-a-third-party-chrome-extension-installed) – Michael Freidgeim May 20 '21 at 13:00
5 Answers
For Firefox: First snippet of code on: AddonManager.jsm - MDN
Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAllAddons(function(aAddons) {
// Here aAddons is an array of Addon objects
});
// This code will execute before the code inside the callback
Must run this code in privelaged javascript, as in not a tab. You can try for specialPowers
though I don't know how that works.
To run privelaged script from your site you will have to create a firefox addon and addEventListener's to your site, like a button to list the addons, you would attach a privelaged function to that.
With the addon you enable/disable addons, but users find that annoying because addons do some obtrsuvie stuff on install sometimes.

- 35,443
- 37
- 154
- 323
-
1This wouldn't help my use case since, a separate add-on would need to installed. – zodvik Mar 07 '14 at 17:17
-
1Dear @Noitidart , I am using your code in index.js as follow: const {AddonManager} = require("resource://gre/modules/AddonManager.jsm"); AddonManager.getAllAddons(function(aAddons) { // Here aAddons is an array of Addon objects });
however it does not work – Hosein Aqajani Dec 22 '15 at 12:04 -
1Oh don't do require @H.Aqjn you should do import. So `var {Cu} = require('chrome');` then do `Cu.import('resoruce://gre/modules/AddonManager.jsm')` then it will work. – Noitidart Dec 22 '15 at 15:27
-
Dear @Noitidart , Your comment was helpful, however I want to use `aAddons` outside of the `AddonManager.getAllAddons(function(aAddons){ ...});` which is an asynchronous callback function. Even when I defined a global variable, it return me `undefined`. – Hosein Aqajani Dec 23 '15 at 06:57
-
I handled this problem using `Timeout` by setting `var{Timeout}=require{"sdk/timers"};` , Is it a good approach? Generally Is it possible for a `less-privileged external page as my server` to retrieve the add-on information of our `privileged java-script as my client` when the add-on of the client is disabled or deactivated or removed? – Hosein Aqajani Dec 23 '15 at 11:23
For Chrome extensions specifically, only certain extensions are detectable so this is not a very good method, but as far as I know, there are no longer any reliable methods to detect browser extensions.
For the extension that you want to detect, you would need its Extension Id and its Web accessible resource.
Some extensions have web accessible resources and some do not. If there is no web accessible resource, you will not be able to detect that extension.
To find the web accessible resource, you will need to look at the extensions chrome.manifest
file. It will tell you if there is web accessible content. For example, the chrome.manifest
file might say:
content web-developer content/web-developer/ contentaccessible=yes
Generally, its not very effective to look for browser extensions since you have to know which extensions you want to detect ahead of time and many times they are undetectable.
Also, here's a good link that I used when I was trying to do the same thing here

- 491
- 5
- 16
NavigatorPlugins.mimeTypes
Take a peek at the MDN page
Hope it helps

- 1,970
- 3
- 33
- 59
-
yes it works for plugins, I'm using it to detect the Shockwave player – fauverism Mar 07 '14 at 16:20
-
In JavaScript check to see if the zip field has been changed while it is hidden and show a warning to the user that an extension might be causing issues.

- 46,583
- 10
- 100
- 152