make loader independent of system and unload modules

RESOLVED FIXED

Status

Add-on SDK
General
P1
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: irakli, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

At the moment cuddlefish depends on: 'api-utils/system' and 'api-utils/unload' modules in order to provide a way for listening load & unload events:
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/tutorials/load-and-unload.html

For a long time all of this functionality had a much better alternative and I think it's time to deprecate this API as it also get's into the way of landing loader to firefox.

I would suggest to change documentation 

https://github.com/mozilla/addon-sdk/blob/master/doc/dev-guide-source/tutorials/load-and-unload.md

to outline alternatives. And implement `deprecated/load-unload` module that will be only loaded if add-on has `exports.main` and `main.onUnload` with appropriate
warnings outlining better alternatives.

Also unload module can be notified about add-on unload using observer service instead.
Priority: -- → P1
Created attachment 615008 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/401

Pointer to Github pull-request
Attachment #615008 - Flags: review?(poirot.alex)
Comment on attachment 615008 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/401

Looks good with very last fixup discussed on irc.
Attachment #615008 - Flags: review?(poirot.alex) → review+

Comment 3

6 years ago
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/d292d75edf1a6aa747bb531b9a72033889566f21
Merge pull request #401 from Gozala/bug/independent-loader@743382

Bug 743382 - Make loader independent of other modules. r=@ochameau
Depends on: 748979
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.