|
|
@ -1,4 +1,4 @@ |
|
|
|
const {app, BrowserWindow, dialog, protocol, ipcMain} = require('electron') |
|
|
|
const {app, BrowserWindow, dialog, protocol, session} = require('electron') |
|
|
|
const {create: createMainWindow} = require('./windows/main') |
|
|
|
const {MANUAL_CREATED_FLAG,} = require('./constant') |
|
|
|
const handleIPC = require('./ipc') |
|
|
@ -16,6 +16,14 @@ if (isFirstInstall) { |
|
|
|
// app.disableHardwareAcceleration()
|
|
|
|
// app.allowRendererProcessReuse = true
|
|
|
|
app.whenReady().then(() => { |
|
|
|
const filter = {urls: ['http://127.0.0.1:5500/*']}; |
|
|
|
session.defaultSession.webRequest.onHeadersReceived(filter, (details,callback) => { |
|
|
|
if(details.responseHeaders && details.responseHeaders['Set-Cookie']){ |
|
|
|
for(let i = 0;i < details.responseHeaders['Set-Cookie'].length;i++) details.responseHeaders['Set-Cookie'][i] += ";SameSite=None;Secure"; |
|
|
|
} |
|
|
|
callback({ responseHeaders: details.responseHeaders}); |
|
|
|
}) |
|
|
|
app.commandLine.appendSwitch('disable-features','BlockInsecurePrivateNetworkRequests') |
|
|
|
// 启动应用时自动启动监控平台接口服务
|
|
|
|
// const child_process = require('child_process')
|
|
|
|
// if (global.worker !== 'start') {
|
|
|
|