From 854b114c041684cbde74ea78fc379bf796be0d4c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 29 Jun 2023 10:04:26 +0200 Subject: [PATCH] LibWeb: Use the script's own URL as filename for fetched classic script This makes JS backtraces actually show the filename of scripts correctly again (instead of the URL of the document that loaded them). --- Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp index 5171433e43..4151fda074 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp @@ -288,7 +288,8 @@ WebIDL::ExceptionOr fetch_classic_script(JS::NonnullGCPtrdocument().url().to_deprecated_string(), source_text, settings_object, response->url().value_or({}), 1, muted_errors); + auto response_url = response->url().value_or({}); + auto script = ClassicScript::create(response_url.to_deprecated_string(), source_text, settings_object, response_url, 1, muted_errors); // 8. Run onComplete given script. on_complete(script);