Closed Bug 1404619 Opened 9 years ago Closed 9 years ago

Promise returning functions not completing in an 'unload' event handler (when disabing addon)

Categories

(WebExtensions :: General, defect)

56 Branch
x86_64
Windows 10
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bertrand.perret, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Steps to reproduce: Firefox 56 release, Load the attached WebExtension from 'about:debugging' Click the 'Debug' link, the console appears Go to Addons Tab Disable the 'ILEX first WebExtension ...' addon In the console, unLoad message is shown (OK) But not the promise resolution handlers (KO) Actual results: In the console, the 'entering unLoad' message is indeed shown (OK) But not the promise resolution handlers (KO) Expected results: One of the two promise handlers should have been called (with a priniting message in the console)
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
Summary: Promise returning functions not completing in an 'unload' event handler → Promise returning functions not completing in an 'unload' event handler (when disabing addon)
Once the unload event comes, your extension is getting shut down and you can't defer it. If you could defer it, extensions could make themselves unkillable (either deliberately or just due to implementation bugs)
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
(In reply to Andrew Swan [:aswan] from comment #1) > Once the unload event comes, your extension is getting shut down and you > can't defer it. If you could defer it, extensions could make themselves > unkillable (either deliberately or just due to implementation bugs) Hi Andrew, thanks for replying. So a WebExtension that is being disabled has no time to do any task ? I tried to use a setTimeout(doTask, 500) for example but no luck ... Is there any event prior to 'unload' that we could trigger though ? ('beforeunload' seems not fired when disabling)
There is no way to do asynchronous work at shutdown time. If you have something specific that you need to do at startup, please describe it and we can evaluate options...
Product: Toolkit → WebExtensions
See Also: → 1606215
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: