Opened on 09/15/2017 at 01:46:43 PM
Closed on 09/16/2017 at 02:14:55 PM
Last modified on 09/17/2017 at 05:45:49 PM
#5696 closed defect (fixed)
Error in lib/compat.js on Firefox during extension initialization
Reported by: | mjethani | Assignee: | mjethani |
---|---|---|---|
Priority: | P3 | Milestone: | Adblock-Plus-3.0-for-Firefox |
Module: | Platform | Keywords: | |
Cc: | sebastian, trev, greiner | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by mjethani)
Environment
Firefox 50+
The current Adblock Plus WebExtensions master
macOS Sierra 10.12.5
How to reproduce
- Install the extension as a "temporary add-on" for debugging in about:debugging#addons
- Click on the Debug button to open the devtools console for the background page
Observed behaviour
Error in the console: "The Components object is deprecated. It will soon be removed."
Expected behaviour
No error.
Attachments (0)
Change History (10)
comment:2 Changed on 09/15/2017 at 02:00:24 PM by mjethani
comment:3 Changed on 09/15/2017 at 02:00:47 PM by mjethani
- Cc greiner added
comment:5 Changed on 09/15/2017 at 04:13:23 PM by sebastian
Yes, Components isn't used anywhere directly (to my knowledge). However, Cc/Ci/Cr/Cu is used across adblockpluscore. Anyway, this abstraction (which emulates internal Gecko APIs) doesn't make sense anymore, with the legacy Gecko extension being replaced. So we should just remove/replace the related code in adblockpluscore.
comment:6 Changed on 09/15/2017 at 06:06:19 PM by abpbot
A commit referencing this issue has landed:
Issue 5696 - Rename Components to ComponentsObject
comment:7 Changed on 09/15/2017 at 10:35:07 PM by mjethani
- Milestone set to Adblock-Plus-for-Chrome-Opera-next
This can be closed now since I've logged #5702.
comment:8 Changed on 09/15/2017 at 10:35:34 PM by mjethani
- Milestone Adblock-Plus-for-Chrome-Opera-next deleted
comment:9 Changed on 09/16/2017 at 02:14:55 PM by sebastian
- Milestone set to Adblock-Plus-for-Chrome-Opera-next
- Resolution set to fixed
- Status changed from new to closed
comment:10 Changed on 09/17/2017 at 05:45:49 PM by sebastian
- Priority changed from Unknown to P3
- Ready set
Interestingly, the error goes away if the variable Components in lib/compat.js is renamed to something else.
As far as I can tell, it could be called anything, since it is only referenced locally. Some of the pages like firstRun.html do reference the window.Components object but they don't include lib/compat.js interestingly.
Note that the let keyword means that the variable is not set as a property on the window object. If that was the intention, we should have used var or set it explicitly. It really looks like common.js in adblockplusui is interested specifically in the original window.Components if it's available, in which case we can rename this variable here in lib/compat.js.