diff --git a/src/main/index.js b/src/main/index.js index 81b2fbe..33a7e5b 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -123,7 +123,8 @@ function createWindow() { ...(process.platform === 'linux' ? { icon } : {}), webPreferences: { preload: join(__dirname, '../preload/index.js'), - sandbox: false + sandbox: false, + webSecurity: false } }) diff --git a/src/preload/index.js b/src/preload/index.js index f7c5fb8..bdde965 100644 --- a/src/preload/index.js +++ b/src/preload/index.js @@ -1,6 +1,8 @@ import electron, { contextBridge, ipcRenderer } from 'electron' import { electronAPI } from '@electron-toolkit/preload' +const http = require('http') + // Custom APIs for renderer const api = {} @@ -11,6 +13,7 @@ if (process.contextIsolated) { try { contextBridge.exposeInMainWorld('electron', electronAPI) contextBridge.exposeInMainWorld('api', api) + contextBridge.exposeInMainWorld('http', http) contextBridge.exposeInMainWorld('baseConfig', { getBaseConfig: () => ipcRenderer.invoke('getBaseConfig') }) @@ -23,6 +26,7 @@ if (process.contextIsolated) { } else { window.electron = electronAPI window.api = api + window.http = http window.electronAPI = { getBaseConfig: () => ipcRenderer.invoke('getBaseConfig') } diff --git a/src/renderer/index.html b/src/renderer/index.html index f05fc87..f00b32f 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -2,11 +2,12 @@
+