// SPDX-FileCopyrightText: 2026 Paula Wisnievski // SPDX-License-Identifier: AGPL-3.0-or-later /// // runs the content phase of the mods' scripts for server/load_mods.ts, without permissions like the game's worker, // since the host that loads mods can read and write files. gets each one's script and answers with what each // registered, in order import { type ContentScriptCode, run_content_script } from "@/common/content_scripts.ts"; import { data_url } from "@/common/mod.ts"; self.onmessage = async (event: MessageEvent) => { const results = []; for (const { code, ...script } of event.data) { results.push(await run_content_script({ ...script, url: data_url(code) })); } self.postMessage(results); };