在开发工具控制台中如何处理 "The Components object is deprecated. It will soon be removed."

What to do about "The Components object is deprecated. It will soon be removed." in dev tools Console

对于我在 Firefox 中打开的几乎每个页面,我都会在开发人员工具栏的控制台中看到此错误:

(!) The Components object is deprecated. It will soon be removed.

来源是 html 页面。它发生在我创建的页面上,但也发生在许多常见的网站上。

我在 MDN 网络文档的 Components object 上找到了这个文档,但这并没有说明很多。请注意,即使该页面也会显示此消息 (!)

看起来像一个警告,但根据控制台过滤器,这是一个错误。

我的主要问题是:

我没有发现任何由此导致的问题。现在,就是这样。

我已经看了一年多了,也许更久。我基本上忽略了这一点,但时不时地它又开始唠叨我。我不希望我的代码突然中断,并希望摆脱这条消息来掩盖其他消息。

这不是页面开发者可以解决的。

骑车回家时,一个可能的原因突然出现在我的脑海中:我使用的某个附加组件是否会导致这种情况,是的,似乎是这种情况。

我用禁用的加载项重新启动,消息消失了。

他们我一次启用一个,罪魁祸首是 Selenium IDE.

A bug report on this issue 已关闭 Won't fix,消息为:

This error will resolve itself when we move to a native app later this year.

在 2012 年的 MozillaZine topic 中,解释了如何解决它。

The first one is just a warning that the addon is using "Components" directly, which won't necessarily always be possible when using the Add-on SDK. (The preferred way to do it is to access the aliases for Components.classes and Components.interfaces and such that the SDK provides by requiring the "chrome" module.) It shouldn't be a problem right now, but might become one in the future.

在我的 FireFox 中安装 Selenium 插件后发生了这种情况。