Reputation: 15702
I want to detect a specific Add-On and if a user has it installed in his Browser. The Plugin is an XPI package.
I know of navigator.plugins
but it should not be mistaken for what I want.
Upvotes: 1
Views: 76
Reputation: 11388
I know you have checked navigator.plugins but I think this is the most accurate you can get. What is mistaken in your case?
var myPlugin = navigator.plugins['pluginName'];
if (myPlugin === undefined) {
// The plugin you're looking for is not present
}
If it's not enough, you still can check into navigator.plugins each object, and check if the descriptions is what you're looking for
AFAIK, if you want to detect if your ads are seen by the users, you should trick with the extension (I think there is a difference between plugin and extension). Create a script that you call "ads.js" Into this script, create an element with a unique ID. Into your app, check if this div has been created. If not, that means that Adblock has prevented the browser to load/run the script
Upvotes: 0
Reputation: 6252
You can find the extensions installed by addon manager.
Or you can just look for nsExtensionManager.js
and use the variable called validExtensions
which is used to create the extensions.ini
as explained here
Upvotes: 1