Closed Bug 1752776 Opened 2 years ago Closed 2 years ago

Plan to support FetchEvent for a service worker

Categories

(WebExtensions :: Untriaged, enhancement)

Firefox 97
enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1344561

People

(Reporter: danny0838, Unassigned)

Details

Expected results:

What is the current for the support of FetchEvent in an extension service worker?

According to my test, manifest v2 doesn't seem to support navigator.serviceWorker in the background page or any extension page. (Always throws a DOMException when called.)

However, manifest v3 will replace the background page with a background service worker. A service worker normally supports FetchEvent, which is powerful and can "host" almost any dynamic content, including arbitrary scripts.

Is there any plan about the support of FetchEvent in the manifest v3 background service worker? Will there be any CSP or protection/restriction?

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Product: Firefox → WebExtensions

This is technically a duplicate of Bug 1344561.

As a side note, we briefly discussed about FetchEvent in extension service workers before, and the consensus in the team was that making an extension service worker to intercept and handle requests to moz-extension:// urls is something that we would prefer to don't allow.

The main reason is that moz-extension:// urls are currently expected to be static resources packages with the extension, and allowing an extension service worker to synthesize some would change that assumption and it would turn into one more source of remote code execution.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.