Bug 246475 - Add support for module scripts in generated background pages for Web Extensions
Summary: Add support for module scripts in generated background pages for Web Extensions
Status: RESOLVED DUPLICATE of bug 247325
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Extensions (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Timothy Hatcher
URL: https://github.com/w3c/webextensions/...
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-10-13 14:54 PDT by Timothy Hatcher
Modified: 2023-02-16 11:43 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2022-10-13 14:54:43 PDT
Currently Google Chrome supports "type": "module" for background serviceWorkers. During our 2022-10-13 meeting, while discussing #282, Safari and Firefox agreed it makes sense to also add support "type": "module" for limited event pages.

Basically given this syntax in manifest.json:

"background": {
  "scripts": ["script1.js", "script2.js"],
  "type": "module"
}

The browser would generate a _generated_background_page.html which looks like this:

<head></head><body>
<script type="module" src="script1.js"></script>
<script type="module" src="script2.js"></script>
</body>
Comment 1 Radar WebKit Bug Importer 2022-10-13 14:55:10 PDT
<rdar://problem/101144817>
Comment 2 Timothy Hatcher 2023-02-16 11:43:21 PST
This was fixed in bug 247325

*** This bug has been marked as a duplicate of bug 247325 ***