Open Bug 1946569 Opened 17 days ago Updated 6 days ago

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)

task

Tracking

()

ASSIGNED

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.

The following details are likely useful to inform plans around this:

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..

This implementation of nsIChannel wraps an inner nsIChannel, and blocks all
calls to asyncOpen until allowAsyncOpen is called on the nsISuspendedChannel.

Assignee: nobody → mconley
Status: NEW → ASSIGNED
Depends on: 1938456

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.

Attachment #9465272 - Attachment description: Bug 1946569 - Part 1: Create nsISuspendedChannel and implementation. r?valentin! → Bug 1946569 - Part 1: Create nsISuspendableChannelWrapper and implementation. r?valentin!
Attachment #9465274 - Attachment description: Bug 1946569 - Part 2: Split out handling for about:newtab and about:home to a separate nsIAboutModule. r?pdahiya!,Mossop!,#home-newtab-reviewers! → Bug 1946569 - Part 2: Split out handling for about:newtab and about:home to a separate nsIAboutModule, replacing nsIAboutNewTabService. r?pdahiya!,Mossop!,#home-newtab-reviewers!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: