Milek7
Milek7

Reputation: 157

Accessing navigator.plugins in Firefox using Add-on SDK

How to access navigator.plugins object in main.js file? I use a Firefox Add-on SDK. ​

Upvotes: 3

Views: 391

Answers (2)

ZER0
ZER0

Reputation: 25332

Every add-on comes with it's own "hidden" window, that could be used for some stuff. It's not well documented, but you should be able to do something like:

let { window: {navigator} } = require('sdk/addon/window');
console.log(navigator.plugins);

Upvotes: 3

Milek7
Milek7

Reputation: 157

var windows = require("sdk/window/utils");
var window = windows.getMostRecentBrowserWindow();
console.log(window.navigator.plugins);

Upvotes: 3

Related Questions