javascript - Detect installed extensions in browsers? - Stack Overflow

Is it possible to detect via JS what extensionsadd ons a user has installed on his browser? The use

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.

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.

Share Improve this question edited Mar 7, 2014 at 17:15 zodvik asked Mar 7, 2014 at 15:36 zodvikzodvik 9212 gold badges9 silver badges22 bronze badges 3
  • 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 pletely 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. – user24950814234 Commented Mar 7, 2014 at 15:48
  • Add-on detection in Chrome: blog.kotowicz/2012/02/intro-to-chrome-addons-hacking.html – user423430 Commented Jan 5, 2017 at 16:56
  • Does this answer your question? Check if user has a third party Chrome extension installed – Michael Freidgeim Commented May 20, 2021 at 13:00
Add a ment  | 

5 Answers 5

Reset to default 1

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.

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.manifestfile. 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

NavigatorPlugins.mimeTypes

Take a peek at the MDN page

https://developer.mozilla/en-US/docs/Web/API/NavigatorPlugins.mimeTypes?redirectlocale=en-US&redirectslug=Web%2FAPI%2FNavigator.mimeTypes

Hope it helps

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.

For Firefox you can do it with Mochitest/SpecialPowersAPI

https://developer.mozilla/en-US/docs/SpecialPowers

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745138489a4613317.html

相关推荐

  • javascript - Detect installed extensions in browsers? - Stack Overflow

    Is it possible to detect via JS what extensionsadd ons a user has installed on his browser? The use

    2小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信