Update to Electron 14

Change-type: minor
This commit is contained in:
Akis Kesoglou 2023-02-14 13:42:29 +02:00
parent c0404597c0
commit df7854111a
5 changed files with 1085 additions and 786 deletions

View File

@ -187,8 +187,6 @@ export class SafeWebview extends React.PureComponent<
const { webContents, ...webviewEvent } = event;
analytics.logEvent('SafeWebview loaded', {
...webviewEvent,
screen_height: webContents?.hostWebContents.browserWindowOptions.height,
screen_width: webContents?.hostWebContents.browserWindowOptions.width,
});
this.setState({
shouldShow: event.statusCode === HTTP_OK,

View File

@ -176,7 +176,6 @@ async function createMainWindow() {
contextIsolation: false,
webviewTag: true,
zoomFactor: width / defaultWidth,
enableRemoteModule: true,
},
});
@ -209,6 +208,7 @@ async function createMainWindow() {
);
const page = mainWindow.webContents;
remoteMain.enable(page);
page.once('did-frame-finish-load', async () => {
console.log('packageUpdatable', packageUpdatable);
@ -228,7 +228,6 @@ async function createMainWindow() {
return mainWindow;
}
electron.app.allowRendererProcessReuse = false;
electron.app.on('window-all-closed', electron.app.quit);
// Sending a `SIGINT` (e.g: Ctrl-C) to an Electron app that registers

1846
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@
"devDependencies": {
"@balena/lint": "5.4.2",
"@balena/sudo-prompt": "9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534",
"@electron/remote": "^1.2.2",
"@electron/remote": "2.0.1",
"@fortawesome/fontawesome-free": "5.15.4",
"@sentry/electron": "^4.1.2",
"@svgr/webpack": "5.5.0",
@ -77,14 +77,14 @@
"css-loader": "5.2.7",
"d3": "4.13.0",
"debug": "4.3.4",
"electron": "^13.6.9",
"electron": "^14.2.9",
"electron-builder": "^23.6.0",
"electron-mocha": "^10.1.0",
"electron-mocha": "^11.0.2",
"electron-notarize": "1.2.2",
"electron-rebuild": "3.2.3",
"electron-updater": "5.3.0",
"esbuild-loader": "2.20.0",
"etcher-sdk": "^8.2.0",
"etcher-sdk": "^8.3.0",
"file-loader": "6.2.0",
"husky": "4.3.8",
"i18next": "21.10.0",
@ -92,7 +92,7 @@
"lint-staged": "10.5.4",
"lodash": "4.17.21",
"mini-css-extract-plugin": "1.6.2",
"mocha": "8.4.0",
"mocha": "^9.1.1",
"native-addon-loader": "2.0.1",
"node-ipc": "9.2.1",
"omit-deep-lodash": "1.1.7",
@ -108,7 +108,7 @@
"semver": "7.3.8",
"simple-progress-webpack-plugin": "1.1.2",
"sinon": "9.2.4",
"spectron": "15.0.0",
"spectron": "^16.0.0",
"string-replace-loader": "3.1.0",
"style-loader": "2.0.0",
"styled-components": "5.3.6",

View File

@ -3,7 +3,11 @@ const { app } = require('electron');
if (app !== undefined) {
// tslint:disable-next-line:no-var-requires
require('@electron/remote/main').initialize();
const remoteMain = require('@electron/remote/main');
app.allowRendererProcessReuse = false;
remoteMain.initialize();
app.on('browser-window-created', (_event, window) =>
remoteMain.enable(window.webContents),
);
}