browser.menus.onShown event listener is not firing when used in multiple contexts and one of them unloads
Categories
(WebExtensions :: Frontend, defect, P2)
Tracking
(firefox74 verified)
Tracking | Status | |
---|---|---|
firefox74 | --- | verified |
People
(Reporter: robwu, Assigned: rpl)
References
Details
Attachments
(4 files)
gOnShownSubscribers
in ext-menus.js
is used to determine whether to dispatch the menus.onShown
event, and is keyed by extension
, but the key is deleted from an unregister
handler that may have multiple instances per extension (specifically up to one per context).
Because of this, if one context unloads, all other listeners of the extension will cease to receive events.
STR:
- Load attached extension.
- Open the global JS console, and check the "Show Content Messages" checkbox.
- Click on the extension button to open a tab.
- Right-click anywhere (e.g. in the current tab's content area) to open a context menu.
- Close the tab from step 3.
- Repeat step 4.
Expected:
- At step 4, the log should contain: "onShown in background" and "onShown in tab"
- At step 6, the log should contain: "onShown in background"
Actual:
- At step 4, the log should contain: "onShown in background" and "onShown in tab"
- At step 6, the log entry is missing.
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
The openContextMenu test helper uses a default selector parameter that doesn't actually exist in the
test page used (which is about:robots) and so the test was getting stuck because the context menu
was not being opened.
This change is unrelated to the issue fixed in this bugzilla issue, but the timeout failure was
preventing to run all the menus test successfully in a local linux build and so it did seem
worth to look into where the test was getting stuck and ensure that it does pass consistently.
Depends on D60493
Comment 4•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e9ef5cbf2ff6
https://hg.mozilla.org/mozilla-central/rev/72146fca884a
Comment 5•5 years ago
|
||
Verified fixed on Windows Pro 10 64-bit and macOS Catalina 10.15 on FF 74.0a1 (20200129213721).
Comment 6•5 years ago
|
||
Description
•