The default bug view has changed. See this FAQ.

Give extensions access to cached favicon URLs

NEW
Unassigned

Status

()

Toolkit
WebExtensions: Request Handling
P3
enhancement
5 months ago
19 days ago

People

(Reporter: Stephan Sokolow, Unassigned)

Tracking

(Blocks: 1 bug)

51 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [design-decision-approved][tabs][triaged])

(Reporter)

Description

5 months ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0
Build ID: 20161017194958

Steps to reproduce:

Tried to write an extension that uses tab titles, urls, and favicons to produce an analogue to the backup and export options in the bookmark manager.


Actual results:

To resolve tabs.Tab.favIconUrl, I had to grant the addon "<all_urls>" permission and I've spent a whole day (and counting) trying to write suitably non-fragile fetch() code when all I want is already retrieved and staring me in the face to the left of each Tab.title.


Expected results:

Given that favicons serve a similar role to tab titles and have similar privacy and permissions implications, there should be a simple API to retrieve the already-in-memory data using only the "tabs" permission and without worrying about cache misses.

In line with the naming scheme already in place, I propose tabs.Tab.favIconBlob.

Updated

5 months ago
Severity: normal → enhancement
Component: Untriaged → WebExtensions: Untriaged
Product: Firefox → Toolkit
Whiteboard: [design-decision-needed]

Updated

5 months ago
Component: WebExtensions: Untriaged → WebExtensions: Frontend
Whiteboard: [design-decision-needed] → [design-decision-needed][tabs]

Comment 1

2 months ago
To be discussed at January 24 WebExtensions Triage mtg. 

Agenda: https://docs.google.com/document/d/1add-6FL8mzksvzbyB83HUmEkVmKERd-nt740AYr-4PE/edit#

Comment 2

2 months ago
We talked about this, and decided that we want to support this use case, but that we should do it by giving extensions access to URLs backed by our favicon cache rather than by handing them image blobs.
Status: UNCONFIRMED → NEW
Component: WebExtensions: Frontend → WebExtensions: Request Handling
Ever confirmed: true
Summary: Add tabs.Tab.favIconBlob to WebExtensions API → Give extensions access to cached favicon URLs
Whiteboard: [design-decision-needed][tabs] → [design-decision-approved][tabs]

Updated

2 months ago
Priority: -- → P3
Whiteboard: [design-decision-approved][tabs] → [design-decision-approved][tabs][triaged]

Updated

2 months ago
webextensions: --- → ?
(Reporter)

Comment 3

2 months ago
(In reply to Kris Maglione [:kmag] from comment #2)
> We talked about this, and decided that we want to support this use case, but

That's good to hear.

> that we should do it by giving extensions access to URLs backed by our
> favicon cache rather than by handing them image blobs.

Is the rationale documented anywhere I could read? I'm curious about what makes cache URLs easier to support than blobs in this situation.

Updated

2 months ago
Duplicate of this bug: 1316097

Comment 5

2 months ago
(In reply to Stephan Sokolow from comment #3)
> Is the rationale documented anywhere I could read? I'm curious about what
> makes cache URLs easier to support than blobs in this situation.

In the case of blobs, we would need to fetch, decode, and store them in memory for every tab, and there would be additional overhead involved in displaying them as well. Providing access to favicon cache URLs has better performance characteristics and a simpler implementation, and still allows extensions to fetch blobs if and when they actually need them.
(Reporter)

Comment 6

2 months ago
...oh yeah! e10s is a thing now!

I was still in a mindset that it'd be cheaper to just reference the existing decoded blob used to render the tab.

(Because I don't know of a way to display an arewee10syet-style report for just the ~30 extensions I have installed and because I don't want to risk my privacy extensions silently failing, I decided to just disable e10s in my Aurora and wait until I'm forced to migrate onto it... despite my loadout and tab use being pathologically unsuited to single-process operation.)
(In reply to Kris Maglione [:kmag] from comment #2)
> We talked about this, and decided that we want to support this use case, but
> that we should do it by giving extensions access to URLs backed by our
> favicon cache rather than by handing them image blobs.

Was the idea to have a tab.faviconUrl property, or some API that would return a (cached) favicon URI for any domain?  And if it's the latter, does it make sense to make it part of the MozURLUtils WebIDL from bug 1315558 comment 4?
Flags: needinfo?(kmaglione+bmo)
My thought was that faviconUrl would point to a URL backed by the favicon cache, and then we'd have to give extensions access to those URLs.
Flags: needinfo?(kmaglione+bmo)
Blocks: 1339561
You need to log in before you can comment on or make changes to this bug.