Open
Bug 1300234
Opened 8 years ago
Updated 1 year ago
addListener methods should return a promise
Categories
(WebExtensions :: General, defect, P3)
Tracking
(Not tracked)
NEW
People
(Reporter: robwu, Unassigned)
References
Details
(Whiteboard: triaged)
Event registration with proxied APIs is asynchronous. This leads to missing events when a WebExtension API is used with other APIs that would trigger the event.
In the next example, I expect an onRemoved event, but I did not receive any, probably because window.close() uses higher-priority IPC than the WebExtensions event implementation.
var win = window.open("http://example.com");
// Wait until the window opens and then run the following:
browser.tabs.onRemoved(tabId => console.log("Removed tab" + tabId));
win.close();
Reporter | ||
Comment 1•8 years ago
|
||
This test: http://searchfox.org/mozilla-central/rev/950e13cca1fda6507dc53c243295044e8eda4493/toolkit/components/extensions/test/mochitest/test_ext_tab_teardown.html#119
fails because the (extension) tab is hosted in the main process, and calling window.close()
synchronously triggers http://searchfox.org/mozilla-central/rev/950e13cca1fda6507dc53c243295044e8eda4493/browser/base/content/tabbrowser.xml#4694
... so the tab is closed before the asynchronous tabs.onRemoved.addListener event has had a chance to run.
Updated•8 years ago
|
Priority: -- → P3
Whiteboard: triaged
Reporter | ||
Comment 2•7 years ago
|
||
Bug 1343940 is another instance of this bug.
Updated•7 years ago
|
Component: WebExtensions: Untriaged → WebExtensions: General
Summary: Events in ChildAPIManager + ParentAPIManager are out of sync with non-WebExtension APIs → addListener methods should return a promise
Updated•6 years ago
|
Product: Toolkit → WebExtensions
Updated•6 years ago
|
status-firefox51:
affected → ---
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•