diff --git a/src/main/index.ts b/src/main/index.ts index 28ce041d0..abf385ea9 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -96,6 +96,19 @@ if (!IS_VANILLA && !IS_EXTENSION) { } }); + protocol.handle("https", async req => { + const res = await net.fetch(req, { bypassCustomProtocolHandlers: true }); + const headers = new Headers(res.headers); + headers.set("Access-Control-Allow-Origin", "*"); + headers.set("Access-Control-Allow-Methods", "*"); + headers.set("Access-Control-Allow-Headers", "*"); + + return new Response(res.body, { + ...res, + headers, + }); + }); + try { if (RendererSettings.store.enableReactDevtools) installExt("fmkadmapgofadopljbjfkapdkoienihi") @@ -106,6 +119,7 @@ if (!IS_VANILLA && !IS_EXTENSION) { initCsp(); }); + } if (IS_DISCORD_DESKTOP) {