简体   繁体   English

使用附加SDK访问Firefox中的navigator.plugins

[英]Accessing navigator.plugins in Firefox using Add-on SDK

How to access navigator.plugins object in main.js file? 如何访问main.js文件中的navigator.plugins对象? I use a Firefox Add-on SDK. 我使用的是Firefox附加SDK。

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

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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM