Search code examples
firefoxdeprecatedfirefox-developer-tools

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


For almost every page I open in Firefox, I see this error in the Console of the developer tool bar:

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

The source is the html page. It happens with pages I create, but also on many common websites.

I found this documentation on Components object on MDN web docs, but that does not clarify a lot. Note that even that page shows this message(!)

It looks like a warning, but according to the Console filter, it is an error.

My main questions are:

  • Is this something for me, as a developer of the page reporting this, to solve?
  • If so, how do I go about that?

I am not aware of any problems as a result of this. For now, that is.

I have seen this for over a year, maybe longer. I mostly ignore this, but every now and then it starts nagging me again. I don't want my code to break suddenly and would like to get rid of this message obscuring other messages.


Solution

  • This is not for the developer of the page to solve.

    While biking back home, a possible cause popped up in my mind: could one of the add-ons I use cause this and yes, that appears to be the case.

    I restarted with disabled add-ons and the message was gone.

    Then I enabled them one at a time and the culprit is Selenium IDE.

    A bug report on this issue was closed with Won't fix, with the message:

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

    In a MozillaZine topic of 2012, it is explained how it could have been solved.

    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.