From abceee4cb811e2638921c48385ab9d177a319bbd Mon Sep 17 00:00:00 2001 From: Zbynek Konecny Date: Fri, 20 Oct 2023 16:03:48 +0200 Subject: [PATCH] Do not set crossOrigin for file protocol (#9854) This allows using GWT compiled code with `installCode=false` also with `file://` protocol. See https://github.com/gwtproject/gwt/issues/9734#issuecomment-1729695795 for the relevant Chrome error message. --- .../google/gwt/core/ext/linker/impl/installScriptDirect.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/installScriptDirect.js b/dev/core/src/com/google/gwt/core/ext/linker/impl/installScriptDirect.js index 725505e0bf..2df43d2615 100644 --- a/dev/core/src/com/google/gwt/core/ext/linker/impl/installScriptDirect.js +++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/installScriptDirect.js @@ -9,7 +9,9 @@ function installScript(filename) { var docbody = doc.body; var script = doc.createElement('script'); script.language='javascript'; - script.crossOrigin=''; + if (location.host) { + script.crossOrigin=''; + } script.src = code; if (__MODULE_FUNC__.__errFn) { script.onerror = function() {