From 5dbc995f73da45ad99b95bc3119c75451b2c415d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 23 Aug 2024 13:26:16 +0200 Subject: Emscritpen: Use WorkerGlobalScope.importScripts Change-Id: I19be38564aca4fdd3d827657055b41a867582ba0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172315 Reviewed-by: Stephan Bergmann Tested-by: Jenkins --- desktop/source/app/appinit.cxx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'desktop/source') diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 4490529a77ba..6253b7afe20b 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -75,13 +75,7 @@ extern "C" void getUnoScriptUrls(std::vector * urls) { } EM_JS(void, runUnoScriptUrl, (char16_t const * url), { - fetch(UTF16ToString(url)).then(res => { - if (!res.ok) { - throw Error( - "Loading <" + res.url + "> failed with " + res.status + " " + res.statusText); - } - return res.blob(); - }).then(blob => blob.text()).then(text => eval(text)); + importScripts(UTF16ToString(url)); }); EM_JS(void, setupMainChannel, (), { -- cgit