From 77bfe8e218ce606f6b78ae194fbd40321fbd7ce5 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Mon, 14 Oct 2024 04:03:51 +0900 Subject: [PATCH] fix: RSS feed CORS issue - Close #1620 --- src/index.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/index.ts b/src/index.ts index a2020fbf..1e0b93a6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,6 +11,7 @@ import { shell, dialog, ipcMain, + protocol, type BrowserWindowConstructorOptions, } from 'electron'; import enhanceWebRequest, { @@ -83,6 +84,34 @@ if (!gotTheLock) { app.exit(); } +protocol.registerSchemesAsPrivileged([ + { + scheme: 'http', + privileges: { + standard: true, + bypassCSP: true, + allowServiceWorkers: true, + supportFetchAPI: true, + corsEnabled: true, + stream: true, + codeCache: true, + }, + }, + { + scheme: 'https', + privileges: { + standard: true, + bypassCSP: true, + allowServiceWorkers: true, + supportFetchAPI: true, + corsEnabled: true, + stream: true, + codeCache: true, + }, + }, + { scheme: 'mailto', privileges: { standard: true } }, +]); + // Ozone platform hint: Required for Wayland support app.commandLine.appendSwitch('ozone-platform-hint', 'auto'); // SharedArrayBuffer: Required for downloader (@ffmpeg/core-mt)