Stop fetching icons from the network in Places
Categories
(Toolkit :: Places, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox133 | --- | fixed |
People
(Reporter: mak, Assigned: daisuke)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [sng][favicons-2024])
Attachments
(3 files, 2 obsolete files)
Places should only be a store of icons, but never fetch them from the network.
There's privacy and security implications in doing that, we prefer to delegate the burden to some dedicated module.
This is already the case for icons stored from the browser tabs, though many components still rely on Places to do the fetching.
Any use of SetAndFetchFaviconForPage should be converted.
PlacesUIUtils.loadFavicon
should be removed, or moved, or changed to only accept data uris (then maybe it won't be particularly useful to keep it).
We have browser/modules/FaviconLoader.sys.mjs
, we could probably move more stuff into it and make it our centralized favicon load module.
Reporter | ||
Comment 1•9 months ago
|
||
This may need a breakdown, as we should likely start converting consumers one by one, and there is module refactoring to make.
The final scope is to remove SetAndFetchFaviconForPage
.
Updated•9 months ago
|
Assignee | ||
Updated•9 months ago
|
Reporter | ||
Comment 2•9 months ago
|
||
Daisuke, this will likely need a breakdown, per comment 1. Probably multiple dependent bugs.
Assignee | ||
Comment 3•9 months ago
•
|
||
Hi Marco, thanks!
Here is the approach I'm thinking of so far.
The nsIFaviconService.setAndFetchFaviconForPage() is doing three major things like below.
- If there is favicon data for the page in database, get the data. (If aForceReload is false)
- If no favicon data from above, get the data from network.
- Save/notify the data.
So, I think we need the following 2 functions to correspond to the above.
getFaviconFromDB()
in PlacesUtils.sys.mjs.getFaviconAsDataURL()
in FaviconLoader.sys.mjs.
Then, change the codes where use nsIFaviconService.setAndFetchFaviconForPage()
to like below.
- Get favicon data from
PlacesUtils.getFaviconFromDB()
(if not forced to reload). - If no favicon data of the above, get it from
FaviconLoader.getFaviconAsDataURL()
. - Call nsIFaviconService.setFaviconForPage().
Next, regarding to PlacesUIUtils.loadFavicon(), it seems that this function is called from only one place. So, I think we can move the function to the place that calls it.
So, I think, as it seems that it will not be so huge, the following patches in this bug might be enough, not breaking down.
- Replace
nsIFaviconService.setAndFetchFaviconForPage()
with new. - Move
PlacesUIUtils.loadFavicon()
toLinkHandlerParent.sys.mjs
(and optimize) - Remove
nsIFaviconService.setAndFetchFaviconForPage()
.
I will do the above first, then, if it looks better to fix each in another bug, I will file them.
Assignee | ||
Comment 4•8 months ago
|
||
Assignee | ||
Comment 5•8 months ago
|
||
Depends on D211692
Assignee | ||
Comment 6•8 months ago
|
||
Depends on D211693
Assignee | ||
Comment 7•8 months ago
|
||
Depends on D211694
Reporter | ||
Updated•8 months ago
|
Reporter | ||
Updated•7 months ago
|
Updated•6 months ago
|
Assignee | ||
Updated•6 months ago
|
Assignee | ||
Comment 8•6 months ago
|
||
Depends on D211695
Assignee | ||
Updated•6 months ago
|
Updated•6 months ago
|
Updated•5 months ago
|
Comment 10•4 months ago
|
||
Backed out 3 changesets (Bug 1894633) as requested by daisuke CLOSED TREE
Backout link: https://hg.mozilla.org/integration/autoland/rev/8b55eb3aa72957c8bfc7526937329818c1ac426a
Comment 11•4 months ago
|
||
Assignee | ||
Updated•4 months ago
|
Comment 12•4 months ago
|
||
Comment 13•4 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/83b1731abb9d
https://hg.mozilla.org/mozilla-central/rev/8b824e3cd55d
https://hg.mozilla.org/mozilla-central/rev/33cddf1e5c70
Description
•