Alternative to runtime.onSuspend?

James Anderson proginosko at
Thu Sep 28 16:10:23 UTC 2017

Thanks, that's helpful. Basically I need to make sure some variables are
saved to local storage. That's going to require calling an asynchronous
function, but I guess it's not crucial for me to confirm that the operation
was successful.


On Thu, Sep 28, 2017 at 11:16 AM, Andrew Swan <aswan at> wrote:

> On Wed, Sep 27, 2017 at 5:52 PM, James Anderson <proginosko at>
> wrote:
>> Thanks for the reply, Andrew. I (wrongly) assumed that onSuspend was the
>> counterpart to onStartup. Also, the documentation on onSuspend says, "This
>> gives the extension an opportunity to do some cleanup."
>> My extension definitely needs to do some cleanup before a Firefox
>> shutdown, but perhaps also before an uninstall.
> You can use an event listener on the "unload" event in your background
> page.  But understand that you can't do anything asynchronous from here --
> the extension is about to be torn down and you can't postpone that.
> Perhaps if you explain what specifically needs to be cleaned up we can
> offer other suggestions.
> -Andrew

James Anderson
Email: proginosko at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Webextensions-support mailing list