mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-08 19:15:09 +00:00
Upgrade to Electron14 (not working)
-- add @electron/remote module -- attempt configuration -- add path-browserify and tsconfig path
This commit is contained in:
@@ -5,6 +5,8 @@ import { Injectable } from '@angular/core'
|
||||
import * as electron from 'electron'
|
||||
import { IPCInvokeEvents, IPCEmitEvents } from '../../../electron/shared/IPCHandler'
|
||||
|
||||
import { app, getCurrentWindow, dialog, session } from '@electron/remote'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -23,7 +25,7 @@ export class ElectronService {
|
||||
}
|
||||
|
||||
get currentWindow() {
|
||||
return this.electron.remote.getCurrentWindow()
|
||||
return getCurrentWindow()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +59,7 @@ export class ElectronService {
|
||||
}
|
||||
|
||||
quit() {
|
||||
this.electron.remote.app.exit()
|
||||
app.exit()
|
||||
}
|
||||
|
||||
openFolder(filepath: string) {
|
||||
@@ -69,10 +71,10 @@ export class ElectronService {
|
||||
}
|
||||
|
||||
showOpenDialog(options: Electron.OpenDialogOptions) {
|
||||
return this.electron.remote.dialog.showOpenDialog(this.currentWindow, options)
|
||||
return dialog.showOpenDialog(this.currentWindow, options)
|
||||
}
|
||||
|
||||
get defaultSession() {
|
||||
return this.electron.remote.session.defaultSession
|
||||
return session.defaultSession
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import * as windowStateKeeper from 'electron-window-state'
|
||||
import * as path from 'path'
|
||||
import * as url from 'url'
|
||||
require('electron-unhandled')({ showDialog: true })
|
||||
require('@electron/remote/main').initialize()
|
||||
|
||||
// IPC Handlers
|
||||
import { getIPCInvokeHandlers, getIPCEmitHandlers, IPCEmitEvents } from './shared/IPCHandler'
|
||||
@@ -94,6 +95,9 @@ function createBridgeWindow() {
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = null // Dereference mainWindow when the window is closed
|
||||
})
|
||||
|
||||
// enable the remote webcontents
|
||||
require("@electron/remote/main").enable(mainWindow.webContents)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,7 +115,6 @@ function createBrowserWindow(windowState: windowStateKeeper.State) {
|
||||
nodeIntegration: true,
|
||||
allowRunningInsecureContent: (isDevBuild) ? true : false,
|
||||
textAreasAreResizable: false,
|
||||
enableRemoteModule: true,
|
||||
contextIsolation: false
|
||||
},
|
||||
simpleFullscreen: true,
|
||||
|
||||
Reference in New Issue
Block a user