我正在尝试使用以下代码覆盖浏览器的通知弹出窗口:
var branch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
但是在 Mozilla Firefox 中,我收到错误 Component.classes 未定义。 在 Chrome 浏览器中,我收到错误“组件未定义”。
嗯,我意识到我需要在我的网站中包含一些内容。但我无法准确找到所需的内容。
请大家帮忙。我在谷歌上搜索了很多,但我以前从未使用过这个东西(类),而且我无法搜索什么可以帮助我。我什至不知道这个东西的标签是什么。我从未使用过 Component 或其类
我的网站在 ZF2。
最佳答案
Components
对象是非标准功能。请参阅https://developer.mozilla.org/en/docs/Components_object .
它还说
Warning: This object is only intended for code running with chrome privileges. Exposing the object to regular web code was a mistake.
关于javascript - 如何在我的网站中加载组件及其类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24574151/