javascript - 如何在我的网站中加载组件及其类

标签 javascript

我正在尝试使用以下代码覆盖浏览器的通知弹出窗口:

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/

相关文章:

javascript - 如何使用 jquery 或 javascript 获取单选按钮 Id 值

javascript - TypeError : utils. requestSendSMSPermission 不是函数

javascript - jQuery 元素值等于 x

javascript - Jquery 表格排序器 : Select for external filter instead of input?

javascript - 将地址簿更改为表格

javascript - 为什么 webpack 可以很好地处理 .png 文件但不能解析 .jpg 文件

javascript - 如何在 d3 的力布局图中获得相同的节点位置

javascript - 使用ajax动态添加时Html视频显示白屏

Javascript 警报在 android react native web View 中不起作用

javascript - 无法对 Google Fusion Tables 进行更改(如插入、添加表格等)