diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp index d5bb096c025cb..76de263609a6f 100644 --- a/dom/script/ScriptLoader.cpp +++ b/dom/script/ScriptLoader.cpp @@ -913,6 +913,14 @@ bool ScriptLoader::ProcessExternalScript(nsIScriptElement* aElement, LOG(("ScriptLoader (%p): Process external script for element %p", this, aElement)); + // Bug 1765745: Support external import maps. + if (aScriptKind == ScriptKind::eImportMap) { + NS_DispatchToCurrentThread( + NewRunnableMethod("nsIScriptElement::FireErrorEvent", aElement, + &nsIScriptElement::FireErrorEvent)); + return false; + } + nsCOMPtr scriptURI = aElement->GetScriptURI(); if (!scriptURI) { // Asynchronously report the failure to create a URI object