Open Bug 1845349 Opened 1 year ago Updated 1 year ago

Is Reader Mode supposed to load favicon from Places?

Categories

(Toolkit :: Reader Mode, task, P3)

task

Tracking

()

People

(Reporter: mak, Unassigned)

References

Details

While working on bug 1844150, I discovered that Reader Mode is checking if the favicon is present in Places, and if it is, it's trying to read it from it.
https://searchfox.org/mozilla-central/rev/d6960b4e32d09bff32865694e32384eb9bca4af5/browser/actors/AboutReaderParent.sys.mjs#104,106-109,112

Unfortunately that never worked.
GetFaviconLinkForIcon generates a moz-anno:favicon:icon_url link, but then iconUri.pathQueryRef.replace(/^favicon:/, "") removes it... So in practice what we pass to the parent is just the icon uri, that will likely be read from the network cache, surely not from Places.

Even if we'd pass a moz-anno:favicon: uri, it wouldn't work because the page cannot access moz-anno:favicon:.
Example: "Security Error: Content at about:reader?url=https%3A%2F%2Fit.wikipedia.org%2Fwiki%2FFerrovie_Federali_Svizzere may not load or link to moz-anno:favicon:https://it.wikipedia.org/static/favicon/wikipedia.ico."

For now I just removed the useless dance of adding/removing moz-anno:favicon:.
If we want to load from Places, we'll need a way to allow moz-anno:favicon: for the tab image.
Otherwise, the getFaviconURLForPage call may not be particularly useful if we could just store the original tab image url when entering reader mode. Or we could use getFaviconDataForPage and always pass a data uri.

It's also possible the status quo, getting the icon from Places but loading it from the network cache, is fine, and then there's nothing else to do.

Severity: -- → N/A
Type: defect → task
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.