diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-08-30 22:10:17 -0400 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-09-05 18:45:45 +0000 |
commit | 9c515323ff6cc0dc42b9ee64397f297b7566d0a4 (patch) | |
tree | d810127ed7385efe0defd15b9da1c770663fa541 /dom/script | |
parent | c2b91aaf8cbb8f263bb335d4e6b8c37de72cfc14 (diff) | |
download | UXP-9c515323ff6cc0dc42b9ee64397f297b7566d0a4.tar UXP-9c515323ff6cc0dc42b9ee64397f297b7566d0a4.tar.gz UXP-9c515323ff6cc0dc42b9ee64397f297b7566d0a4.tar.lz UXP-9c515323ff6cc0dc42b9ee64397f297b7566d0a4.tar.xz UXP-9c515323ff6cc0dc42b9ee64397f297b7566d0a4.zip |
Issue #618 - Don't preload nomodule scripts when modules are enabled (uplift)
Diffstat (limited to 'dom/script')
-rw-r--r-- | dom/script/ScriptLoader.cpp | 17 | ||||
-rw-r--r-- | dom/script/ScriptLoader.h | 4 |
2 files changed, 16 insertions, 5 deletions
diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp index 989301b91..0052c72fe 100644 --- a/dom/script/ScriptLoader.cpp +++ b/dom/script/ScriptLoader.cpp @@ -2576,13 +2576,15 @@ ScriptLoader::ParsingComplete(bool aTerminated) } void -ScriptLoader::PreloadURI(nsIURI *aURI, const nsAString &aCharset, +ScriptLoader::PreloadURI(nsIURI *aURI, + const nsAString &aCharset, const nsAString &aType, const nsAString &aCrossOrigin, const nsAString& aIntegrity, bool aScriptFromHead, bool aAsync, bool aDefer, + bool aNoModule, const mozilla::net::ReferrerPolicy aReferrerPolicy) { NS_ENSURE_TRUE_VOID(mDocument); @@ -2591,9 +2593,16 @@ ScriptLoader::PreloadURI(nsIURI *aURI, const nsAString &aCharset, return; } - // TODO: Preload module scripts. - if (mDocument->ModuleScriptsEnabled() && aType.LowerCaseEqualsASCII("module")) { - return; + if (mDocument->ModuleScriptsEnabled()) { + // Don't load nomodule scripts. + if (aNoModule) { + return; + } + + // TODO: Preload module scripts. + if (aType.LowerCaseEqualsASCII("module")) { + return; + } } SRIMetadata sriMetadata; diff --git a/dom/script/ScriptLoader.h b/dom/script/ScriptLoader.h index ed1e6acbc..20e76970f 100644 --- a/dom/script/ScriptLoader.h +++ b/dom/script/ScriptLoader.h @@ -479,13 +479,15 @@ public: * @param aIntegrity The expect hash url, if avail, of the request * @param aScriptFromHead Whether or not the script was a child of head */ - virtual void PreloadURI(nsIURI *aURI, const nsAString &aCharset, + virtual void PreloadURI(nsIURI *aURI, + const nsAString &aCharset, const nsAString &aType, const nsAString &aCrossOrigin, const nsAString& aIntegrity, bool aScriptFromHead, bool aAsync, bool aDefer, + bool aNoModule, const mozilla::net::ReferrerPolicy aReferrerPolicy); /** |