mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-15 23:36:32 +00:00
Merge pull request #4003 from balena-io/update-electron
Update to Electron 14
This commit is contained in:
commit
c63c98b80a
@ -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,
|
||||
|
@ -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
1846
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -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",
|
||||
|
@ -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),
|
||||
);
|
||||
}
|
||||
|
@ -276,28 +276,6 @@ const commonConfig = {
|
||||
`,
|
||||
replace: "require('./build/Release/Generator.node')",
|
||||
}),
|
||||
// Use the copy of blobs in the generated folder and rename node_modules -> modules
|
||||
// See the renameNodeModules function above
|
||||
replace(/node_modules\/node-raspberrypi-usbboot\/build\/index\.js$/, {
|
||||
search:
|
||||
"return await readFile(Path.join(__dirname, '..', 'blobs', filename));",
|
||||
replace: outdent`
|
||||
const { app, remote } = require('electron');
|
||||
return await readFile(
|
||||
Path.join(
|
||||
// With macOS universal builds, getAppPath() returns the path to an app.asar file containing an index.js file which will
|
||||
// include the app-x64 or app-arm64 folder depending on the arch.
|
||||
// We don't care about the app.asar file, we want the actual folder.
|
||||
(app || remote.app).getAppPath().replace(/\\.asar$/, () => process.platform === 'darwin' ? '-' + process.arch : ''),
|
||||
'generated',
|
||||
__dirname.replace('node_modules', 'modules'),
|
||||
'..',
|
||||
'blobs',
|
||||
filename
|
||||
)
|
||||
);
|
||||
`,
|
||||
}),
|
||||
// Copy native modules to generated folder
|
||||
{
|
||||
test: /\.node$/,
|
||||
|
Loading…
x
Reference in New Issue
Block a user