mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-31 08:20:07 +08:00
⬆️ 升级 electron 到 26
This commit is contained in:
@@ -2,11 +2,16 @@ import { app, BrowserWindow, protocol, nativeTheme } from 'electron';
|
||||
import path from 'path';
|
||||
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib';
|
||||
import versonHandler from '../common/versionHandler';
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require('@electron/remote/main').initialize();
|
||||
|
||||
export default () => {
|
||||
let win: any;
|
||||
|
||||
const init = () => {
|
||||
createWindow();
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require('@electron/remote/main').enable(win.webContents);
|
||||
};
|
||||
|
||||
const createWindow = async () => {
|
||||
@@ -22,7 +27,6 @@ export default () => {
|
||||
backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c28' : '#fff',
|
||||
webPreferences: {
|
||||
webSecurity: false,
|
||||
enableRemoteModule: true,
|
||||
backgroundThrottling: false,
|
||||
contextIsolation: false,
|
||||
webviewTag: true,
|
||||
|
||||
@@ -33,6 +33,8 @@ export default () => {
|
||||
const init = (plugin, window: BrowserWindow) => {
|
||||
if (view === null || view === undefined) {
|
||||
createView(plugin, window);
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require('@electron/remote/main').enable(view.webContents);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -65,7 +67,6 @@ export default () => {
|
||||
|
||||
view = new BrowserView({
|
||||
webPreferences: {
|
||||
enableRemoteModule: true,
|
||||
webSecurity: false,
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false,
|
||||
|
||||
Reference in New Issue
Block a user