Wait for New Tab built-in addon to be enabled before allowing navigations to about:home and about:newtab to complete
Categories
(Firefox :: New Tab Page, task)
Tracking
()
People
(Reporter: mconley, Assigned: mconley)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: [hnt-trainhop])
Attachments
(3 files)
Normally, a known built-in addon is initialized very quickly during startup. There is, however, a race here - the initialization of the New Tab built-in addon via the AddonManager is async, and requests to load about:home / about:newtab may arrive before that initialization completes.
We need to solve this. I've been talking to valentin, and it might be possible to suspend the nsIChannel's for about:newtab / about:home until the addon is enabled.
Updated•17 days ago
|
Comment 1•17 days ago
|
||
The following details are likely useful to inform plans around this:
-
the
WebExtensionPolicy
webidl includes areadyPromise
attribute which is created when the related extension has initiated its asynchonous startup and then resolved when the extension startup is far enough to be ready to resolve moz-extension url -
WebExtension::ReadyPromise
is then used internally by the ExtensionProtocolHandler::SubstituteChannel here to wait for the extension readyPromise to be resolved before starting to serve data from requests to moz-extension urls
The internals described above have been introduced by Bug 1518863 - Blank new tab page displayed on start when an add-on controls the new tab page (due to race between page load and extension startup) to fix a race between Firefox starting up and trying to load a WebExtensions provided new tab page and the extension providing that new tab page starting up, and so it should be relevant and useful also for a buil-in addon provided new tab page..
Assignee | ||
Comment 2•13 days ago
|
||
This implementation of nsIChannel wraps an inner nsIChannel, and blocks all
calls to asyncOpen until allowAsyncOpen is called on the nsISuspendedChannel.
Updated•13 days ago
|
Assignee | ||
Comment 3•13 days ago
|
||
Assignee | ||
Comment 4•13 days ago
|
||
This uses the SharedData map to signal to the privileged about content process
that the New Tab built-in addon has initialized. I chose the SharedData map
because it has a pre-existing synchronization mechanism between processes,
and the value that it writes will not need to get refreshed in the event
that the privileged about content process crashes and needs to be respawned.
Updated•11 days ago
|
Updated•6 days ago
|
Description
•