From 9aabe887958e78721176009bba2f945929a86f14 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 24 May 2025 21:27:34 +1200 Subject: [PATCH] WebWorker: Ensure global object has URL set before fetching As explained by the comment in the code. I believe this to be a spec issue, which I will report. --- Services/WebWorker/WorkerHost.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Services/WebWorker/WorkerHost.cpp b/Services/WebWorker/WorkerHost.cpp index 8031ca5e568..e076b03dd31 100644 --- a/Services/WebWorker/WorkerHost.cpp +++ b/Services/WebWorker/WorkerHost.cpp @@ -245,6 +245,11 @@ void WorkerHost::run(GC::Ref page, Web::HTML::TransferDataHolder mess }; auto on_complete = Web::HTML::create_on_fetch_script_complete(inside_settings->vm().heap(), move(on_complete_function)); + // AD-HOC: Fetching a script performs actions such as for blobs checking that they are on the same partition + // based on origin. However, this is performed before the consume body algorithm is run, where + // this URL for that worker is set. As a workaround, set the URL upfront. + worker_global_scope->set_url(m_url); + // 14. Obtain script by switching on the value of options's type member: // classic: Fetch a classic worker script given url, outside settings, destination, inside settings, // and with onComplete and performFetch as defined below.