Merge pull request #211 from LLK/electron-15

Update to Electron 15
This commit is contained in:
Christopher Willis-Ford 2021-11-10 10:38:17 -08:00 committed by GitHub
commit 4b462212a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 529 additions and 281 deletions

797
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -39,11 +39,11 @@
"babel-loader": "^8.1.0", "babel-loader": "^8.1.0",
"babel-plugin-react-intl": "^7.5.7", "babel-plugin-react-intl": "^7.5.7",
"copy-webpack-plugin": "^5.1.1", "copy-webpack-plugin": "^5.1.1",
"electron": "^8.2.5", "electron": "^15.3.1",
"electron-builder": "^22.11.5", "electron-builder": "^22.13.1",
"electron-devtools-installer": "^3.0.0", "electron-devtools-installer": "^3.2.0",
"electron-notarize": "^0.3.0", "electron-notarize": "^1.1.1",
"electron-store": "^5.1.1", "electron-store": "^8.0.1",
"electron-webpack": "^2.8.2", "electron-webpack": "^2.8.2",
"eslint": "^7.0.0", "eslint": "^7.0.0",
"eslint-config-scratch": "^6.0.0", "eslint-config-scratch": "^6.0.0",

View file

@ -171,6 +171,7 @@ const createWindow = ({search = null, url = 'index.html', ...browserWindowOption
useContentSize: true, useContentSize: true,
show: false, show: false,
webPreferences: { webPreferences: {
contextIsolation: false,
nodeIntegration: true nodeIntegration: true
}, },
...browserWindowOptions ...browserWindowOptions
@ -291,6 +292,7 @@ const createMainWindow = () => {
// don't clean up until after the message box to allow troubleshooting / recovery // don't clean up until after the message box to allow troubleshooting / recovery
await dialog.showMessageBox(window, { await dialog.showMessageBox(window, {
type: 'error', type: 'error',
title: 'Failed to save project',
message: `Save failed:\n${userChosenPath}`, message: `Save failed:\n${userChosenPath}`,
detail: e.message detail: e.message
}); });
@ -311,6 +313,7 @@ const createMainWindow = () => {
webContents.on('will-prevent-unload', ev => { webContents.on('will-prevent-unload', ev => {
const choice = dialog.showMessageBoxSync(window, { const choice = dialog.showMessageBoxSync(window, {
title: productName,
type: 'question', type: 'question',
message: 'Leave Scratch?', message: 'Leave Scratch?',
detail: 'Any unsaved changes will be lost.', detail: 'Any unsaved changes will be lost.',