Closed Bug 1447130 Opened 2 years ago Closed 2 years ago
We will need to do this in order to support the Add-ons team removing support for boostrapped addons. There are a few possible ways to do this which we discussed at the San Fran All Hands, including: * migrating to a web extension * migrating away from being a system add-on to being a regular Firefox component
When we talked in the SF, it was the case that loading as a web-extension would likely delay startup in some way, but that the WebExtensions team had bug 1378459 tracking that. That bug just sprouted some proof-of-concept patches; linking to it here.
See Also: → webextensions-startup
Severity: normal → enhancement
Iteration: --- → 62.2 - Jun 4
Priority: -- → P2
The "basic" steps of component-ify-ing is to replace the functionality provided by legacy bootstrap extensions -- in our case, mainly bootstrap.js and install.rdf. (Where we already have a bunch of custom packaging with jar.mn already.) Some functionality can just be removed as we don't need to support uninstalling/reinstalling/upgrading/downgrading a live extension. I believe this is the current lifecycle: 1) activity-stream bootstrap.js is loaded very early as that's when extensions get loaded - this does minimal startup work waiting for "sessionstore-windows-restored" - https://searchfox.org/mozilla-central/source/browser/extensions/activity-stream/bootstrap.js 2) browser.js starts aboutNewTabService from delayedStartup - https://searchfox.org/mozilla-central/rev/28daa2806c89684b3dfa4f0b551db1d099dda7c2/browser/base/content/browser.js#1438-1441 3) aboutNewTabService (on main process) loads/calls AboutNewTab.init() - https://searchfox.org/mozilla-central/source/browser/components/newtab/aboutNewTabService.js 4) AboutNewTab.init() registers RemotePages - this needs to happen early to catch the initial about:home/newtab - https://searchfox.org/mozilla-central/source/browser/modules/AboutNewTab.jsm 5) "sessionstore-windows-restored" triggers a deferred activity stream startup - this loads resource://activity-stream/lib/ActivityStream.jsm and the rest of activity stream - this is deferred to avoid talos sessionrestore - this also finds all potentially loaded modules to unload them on shutdown (so live upgrade of add-on can re-register) 6) activity stream INIT action and other stuff happens - this also handles early about:newtab type pages that RemotePages noticed but ActivityStream.jsm wasn't ready yet … 7) "quit-application-granted" - aboutNewTabService calls its uninit and AboutNewTab.uninit (for main) 8) bootstrap.js shutdown - call activityStream.uninit() to dispatch UNINIT action - unload modules We should be able to move bootstrap.js into AboutNewTab. Details: move (1) bootstrap.js startup related bits into (4) AboutNewTab.init to wait for "sessionstore-windows-restored" and move (5) deferred loading as part of AboutNewTab module. Similarly we can move (8) shutdown to be handled in (7) AboutNewTab.uninit(). I think we can break this transition into some steps by having both bootstrap.js and AboutNewTab coexisting without actually moving browser/extensions/activity-stream at the same time. If we have AboutNewTab handle `new ActivityStream()` and `activityStream.uninit()` as described above, we can leave other extension-specific stuff in bootstrap.js.
All dependent bugs resolved and successfully exported with bug 1478870!
Component: Activity Streams: Newtab → New Tab Page
11 months ago
Summary: Component-ify → [meta] Component-ify
You need to log in before you can comment on or make changes to this bug.