[Plugins] Move to support polymanifest

This commit is contained in:
Beef 2023-01-04 22:39:28 +00:00
parent 57df878f65
commit 62933bc5ba
3 changed files with 19 additions and 7 deletions

View file

@ -27,7 +27,8 @@ export async function fetchPlugin(url: string) {
// TODO: Remove duplicate error if possible
try {
pluginJs = await (await fetch(new URL("plugin.js", url), { cache: "no-store" })).text()
// by polymanifest spec, plugins should always specify their main file, but just in case
pluginJs = await (await fetch(new URL(pluginManifest.main || "index.js", url), { cache: "no-store" })).text();
} catch {
throw new Error(`Failed to fetch JS for ${url}`);
}