Open
Bug 1451545
Opened 7 years ago
Updated 2 years ago
Support loading content scripts as ES6 modules
Categories
(WebExtensions :: General, enhancement, P3)
Tracking
(Not tracked)
NEW
People
(Reporter: e7358d9c, Unassigned)
References
Details
(Whiteboard: [dev-ux])
Spun off from bug 1394303, because allowing content scripts to be modules is much more complex than doing the same thing for background scripts.
(In reply to ExE Boss from bug 1394303 comment #9)
> If we add a `module` property to the `background` manifest key, we should
> also add it to the `content_scripts` key, as that also needs to support
> being a module, and unlike background scripts, where there’s the workaround
> of using a background page, there’s no currently way to load content scripts
> as modules.
(In reply to Kris Maglione [:kmag] from bug 1394303 comment #10)
> This is a trivial change for background scripts. For content scripts, it
> would be a very large amount of work.
Updated•7 years ago
|
Priority: -- → P3
Updated•7 years ago
|
No longer blocks: webextensions-additional-apis
Can we consider doing this?
manifest support:
```
"content_scripts": [
{
"matches": ["*://*.mozilla.org/*"],
"js": [{
"type": "module",
"src": "borderify.js"
}]
}
]
```
Browser Extension API support:
```
browser.tabs.executeScript({
type: 'module',
code: `console.log('location:', window.location.href);`
});
```
Comment 2•7 years ago
|
||
We can consider doing something like that, though I'd prefer "module": "borderify.js" to match the <script> tag behavior.
But considering doing it and actually doing it are separate things. Supporting this requires a large amount of platform work.
Updated•6 years ago
|
No longer blocks: harmony:modules
No longer depends on: modules-0
Updated•6 years ago
|
No longer blocks: shumway-webext
Updated•6 years ago
|
Product: Toolkit → WebExtensions
Updated•6 years ago
|
Severity: normal → enhancement
Whiteboard: [dev-ux]
Updated•4 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•