w3c / webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)
Other
575 stars 50 forks source link

Proposal: Extension Loading Priority #557

Open erosman opened 3 months ago

erosman commented 3 months ago

Proposal: Extension Loading Priority

There are extensions that due to their specific functions, need to be loaded as soon as possible. For example, extensions with the following permissions would need to be prioritised:

It would be good to have a consensus on the issue.

xeenon commented 3 months ago

Safari does not support privacy or proxy permissions, but we do load extensions right away at launch to have content blockers and injected scripts ready before pages load.

Rob--W commented 3 months ago

Added https://github.com/w3c/webextensions/labels/spec%20clarification because a call out to early startup behavior in the spec, even a non-normative note would be useful. It is not clear whether we can require browser implementations to activate on early startup due to the performance impact any such guarantees would have, so I expect that we cannot do more other than adding a non-normative note.

In practice, Firefox tries to make sure that extensions are loaded in situations where needed. The proxy and webRequest APIs specifically block the startup (implemented in https://bugzilla.mozilla.org/show_bug.cgi?id=1447551). Due to performance concerns we haven't implemented that for declarativeNetRequest yet (https://bugzilla.mozilla.org/show_bug.cgi?id=1821676).

erosman commented 3 months ago

It should also be noted that the priority should also apply when compared with other extensions. That is to say, extensions with above specific functions should be loaded BEFORE other extensions.