Article about module support in web extensions
- Dominant language
- Markdown
- Stars
- 11k
- Forks
- 23.2k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 331
Description
### What would you like to see added to BCD?
### Preamble
The identical proposal applies to both [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) & [import()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import). If required, I can split them into 2 topics.
### Details
The following relevant data would be beneficial to have in BCD (as finding the data requires going through many pages).
- Available in workers (already listed in both) :heavy_check_mark:
- Available in background service worker (MV3)
- Available in background event page (MV3)
- Available in background scripts (MV2)
Available by loading background script as module via a background page
- Available in content script
Also relevant to:
- [background](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background)
- [content_scripts](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts)
### Reference
[Support type: "module" (background service worker as a ES module)](https://bugzilla.mozilla.org/show_bug.cgi?id=1775574)
[Support type: "module" (event page, not background service worker)](https://bugzilla.mozilla.org/show_bug.cgi?id=1811443)
[Support loading content scripts as ES6 modules](https://bugzilla.mozilla.org/show_bug.cgi?id=1451545)
[Dynamic module import doesn't work in webextension content scripts](https://bugzilla.mozilla.org/show_bug.cgi?id=1536094)
[Dynamic import fails in content script in MV3 extension](https://bugzilla.mozilla.org/show_bug.cgi?id=1803950)
### How impactful do you think this enhancement will be?
Provide additional data as per aforementioned
### Do you have anything more you want to share?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.