Open Bug 2086712 Opened 25 days ago Updated 25 days ago

activeTab permission grant should be tied to tab's URL/host, not the tab's document

Categories

(WebExtensions :: General, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-needed, Whiteboard: [wecg][addons-jira])

Granting activeTab in Firefox currently grants access to the tab's content, identified by the document within (in terms of extension API concepts, documentId).

Chrome and Safari have a different approach: They grant host permissions based on the tab's URL, and we are willing to align on that behavior: https://github.com/w3c/webextensions/pull/1152#issuecomment-6468577315

In the WEWG we are working on specifying activeTab (https://github.com/w3c/webextensions/pull/1152); we identified some differences between Chrome and Safari, as well as some subtleties. When these are resolved we should implement the specified behavior.

Implementing this will enable more extension APIs to benefit from the activeTab grant (e.g. bug 1617479), and also enable a longer scope of the grant (past same-origin navigations - bug 1805687).

This change is expected to be backwards-compatible, except for one edge case involving bfcache navigation. The specified activeTab grant ends when a cross-origin navigation happens. But Firefox's current behavior, which ties activeTab to the documentId, retains the permission when the bfcached document is resumed (however, if activeTab is granted again for the latest tab, the original activeTab grant is forgotten, so it was already not fully reliable in the first place).

Firefox's current behavior was documented in https://github.com/mdn/content/pull/45263 (rendered at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/activeTab_permission). When we land the implementation, we should restructure parts of the article (that currently highlight differences between browsers) to document the desired behavior as aligned on between browsers, and leave Firefox's original behavior as a historical note.

Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.