Open Bug 1630999 Opened 5 years ago Updated 3 years ago

webRequest overhead for data: urls from about:newtab

Categories

(Firefox :: New Tab Page, defect, P3)

defect

Tracking

()

Performance Impact medium

People

(Reporter: aswan, Assigned: mconley)

References

Details

(Keywords: perf:frontend, perf:startup)

+++ This bug was initially created as a clone of Bug #1630737 +++

There's more context in bug 1630737 but if any tabs are open on about:newtab, then when a page is loaded in another tab, a thumbnail image of that page is (sometimes?) loaded in about:newtab with a data: url

Using large data: urls imposes overhead when there are extensions present with webRequest listeners (see bug 1490932 and bug 1630737 for more detail). Since extensions are not allowed to see requests that initiate from about: pages, we could eliminate some overhead by not sending urls to the parent process in this case (the relevant code is in toolkit/components/extensions/webrequest/WebRequestContent.js).

Alternatively, perhaps about:newtab could use blob urls instead of data urls, that would avoid the specific webRequest problem and would be more efficient generally.

I recently implement moz-page-thumb for the about:newtab page (bug 1184701), which should be used for all of the page thumbnails generated by the background thumbnailer.

Which ones are still using data URLs?

Whoops, looks like its not the actual thumbnails, but the favicons displayed in "Top Sites"
Most of these are small, but its not unusual for them to be a several KB

These seem to come from https://searchfox.org/mozilla-central/rev/aec63591821712236a522f7f55116f582ed7c920/toolkit/modules/NewTabUtils.jsm#927-933 .

As a simple example, I've started doing more language learning during this whole covid lockdown thing, and so duolingo shows up. The resulting style attribute (because we're using a background-image) is nearly 20k characters long.

Assignee: nobody → mconley
Priority: -- → P3
Whiteboard: [qf][fxperf] → [qf][fxperf:p2]
Whiteboard: [qf][fxperf:p2] → [qf:p2][fxperf:p2]

Support for data:-URLs is dropped from webRequest in bug 1631933.

If there is anything else to do? If so, please update the summary.

Depends on: 1631933

The severity field is not set for this bug.
:thecount, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(sdowne)
Severity: -- → S4
Flags: needinfo?(sdowne)
Performance Impact: --- → P2
Whiteboard: [qf:p2][fxperf:p2] → [fxperf:p2]

Note that I think about:home / about:newtab migrated to using the moz-page-thumbs mechanism, so this may no longer be an issue - but we should make sure there aren't any lingering data URIs around.

Whiteboard: [fxperf:p2]
You need to log in before you can comment on or make changes to this bug.