Open Bug 1886545 Opened 8 months ago Updated 8 months ago

WebExtensions stub `gBrowser` implementation in webext-panels.js to associate `null` tab

Categories

(WebExtensions :: Frontend, task, P3)

Desktop
All
task

Tracking

(Not tracked)

People

(Reporter: Gijs, Unassigned)

References

Details

I tried to remove the stub in bug 1705440 but that broke browser_ext_sidebarAction_contextMenu.js because it strict-equals-checks that the tab param passed is null:

https://searchfox.org/mozilla-central/rev/b73676a106c1655030bb876fd5e0a6825aee6044/browser/components/extensions/test/browser/browser_ext_sidebarAction_contextMenu.js#78-84

let tab = await extension.awaitMessage("menu-click");
is(
  tab,
  null,
  "tab argument is optional, and missing in clicks from sidebars"
);

And once the stub is removed nothing really breaks but the value is undefined. I wasn't sure if that would potentially affect add-ons so didn't want to mess with it and put the stub back.

On the whole this stub is a somewhat awkward way of dealing with dependencies from the context menu code directly on gBrowser - it would be nice if we had a better abstraction for this.

Severity: -- → N/A
Type: defect → task
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.