Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Enable <script type="module"> for content behind a pref

RESOLVED FIXED in Firefox 54



DOM: Core & HTML
6 months ago
4 months ago


(Reporter: evilpie, Assigned: jonco)


(Blocks: 2 bugs, {dev-doc-complete, DevAdvocacy})

dev-doc-complete, DevAdvocacy
Dependency tree / graph

Firefox Tracking Flags

(firefox54 fixed)



(1 attachment)

We should let people experiment with modules. Hopefully we can actually ship milestone 0 soon. If CORS is the last thing blocking that I would suggest shipping with CORS first. Oh and look at what Safari and possibly Chrome are implementing.
Keywords: dev-doc-needed

Comment 1

6 months ago
Worth sending an "intent to experiment" or something, possibly.

I'm not seeing an obvious bug on the CORS thing in the dep tree of bug 568953.  Is that filed?


6 months ago
Keywords: DevAdvocacy


6 months ago
Component: JavaScript Engine → DOM: Core & HTML

Comment 2

6 months ago
The current plan is to enable this behind a pref.  This will allow easier testing with web platform tests too.
Assignee: nobody → jcoppeard
Summary: Enable <script type="module"> for content on Nightly → Enable <script type="module"> for content behind a pref


6 months ago
Blocks: 1330682


5 months ago
Blocks: 1337780

Comment 3

5 months ago
I sent an "Intent to implement" to dev.platform a few weeks ago:!topic/

Comment 4

5 months ago
Created attachment 8834912 [details] [diff] [review]

Patch to enable modules with dom.moduleScripts.enabled pref.
Attachment #8834912 - Flags: review?(bkelly)
Comment on attachment 8834912 [details] [diff] [review]

Review of attachment 8834912 [details] [diff] [review]:

::: dom/base/nsScriptLoader.cpp
@@ +658,5 @@
>  bool
> +nsScriptLoader::ModuleScriptsEnabled()
> +{
> +  return nsContentUtils::IsChromeDoc(mDocument) ||
> +         mozilla::Preferences::GetBool("dom.moduleScripts.enabled", false);

Do you want to use Preferences::AddBoolVarCache() instead since it looks like this gets consulted on every script load?  I'm not sure how slow GetBool() itself is.
Attachment #8834912 - Flags: review?(bkelly) → review+

Comment 6

5 months ago
GetBool is mostly a hashtable lookup and a bunch of method calls.  But yes, using a bool var cache here would be much better.

Comment 7

5 months ago
Also, no need for that "mozilla::" noise in this file.

Comment 8

5 months ago
Great, I'll use that then.

Comment 9

5 months ago
Pushed by
Enable <script type="module"> behind a pref r=bkelly

Comment 10

5 months ago
Last Resolved: 5 months ago
status-firefox54: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
I've added a note about this to our Experimental features page:

I've removed the mention that had been added to the Fx54 release notes, as it is not usually our policy to mention features there until they are enabled by default, afaiu.

Let me know if that looks OK.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.