Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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)


Firefox 50+
The current Adblock Plus WebExtensions master
macOS Sierra 10.12.5

How to reproduce

  1. Install the extension as a "temporary add-on" for debugging in about:debugging#addons
  2. 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.

Change History (10)

comment:1 Changed 3 years ago by mjethani

  • Description modified (diff)

comment:2 Changed 3 years ago by mjethani

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.

comment:3 Changed 3 years ago by mjethani

  • Cc greiner added

comment:4 Changed 3 years ago by mjethani

  • Review URL(s) modified (diff)

comment:5 Changed 3 years ago 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 3 years ago by abpbot

A commit referencing this issue has landed:
Issue 5696 - Rename Components to ComponentsObject

comment:7 Changed 3 years ago by mjethani

  • Milestone set to Adblock-Plus-for-Chrome-Opera-next

This can be closed now since I've logged #5702.

comment:8 Changed 3 years ago by mjethani

  • Milestone Adblock-Plus-for-Chrome-Opera-next deleted

comment:9 Changed 3 years ago by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-next
  • Resolution set to fixed
  • Status changed from new to closed

comment:10 Changed 3 years ago by sebastian

  • Priority changed from Unknown to P3
  • Ready set
Note: See TracTickets for help on using tickets.