ladybird/Libraries/LibWeb/Worker/WebWorkerServer.ipc
CountBleck 2f96ef33fe LibWeb: Ensure that worker script fetches set the correct referrer
The fetch requests for web worker scripts should be treated as if they
occurred in the caller global scope (which may be a Window) and not the
new worker's global scope. The referrer-policy/4K WPT subtests,
specifically those that test worker subresources, depend on this
behavior to work correctly. This commit fixes many of these subtests,
albeit via a hack where the serialized ESO's creation url is set to
the caller's document URL.
2026-01-31 22:45:08 +01:00

22 lines
835 B
Text

#include <LibURL/URL.h>
#include <LibIPC/File.h>
#include <LibWeb/Bindings/AgentType.h>
#include <LibWeb/Bindings/WorkerPrototype.h>
#include <LibWeb/HTML/StructuredSerialize.h>
#include <LibWeb/HTML/Scripting/SerializedEnvironmentSettingsObject.h>
endpoint WebWorkerServer {
start_worker(URL::URL url,
Web::Bindings::WorkerType type,
Web::Bindings::RequestCredentials credentials,
String name,
Web::HTML::TransferDataEncoder message_port,
Web::HTML::SerializedEnvironmentSettingsObject outside_settings,
Web::Bindings::AgentType agent_type,
Optional<URL::URL> document_url_if_started_by_window_fixme) =|
close_worker() =|
handle_file_return(i32 error, Optional<IPC::File> file, i32 request_id) =|
}