From c6d319e333a4d466e42370463467dcc804041790 Mon Sep 17 00:00:00 2001 From: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:02:29 -0700 Subject: [PATCH] Desktop: Upgrade to Electron 32.2.0 (#11200) --- packages/app-desktop/bridge.ts | 3 +-- packages/app-desktop/gui/NoteTextViewer.tsx | 2 +- .../integration-tests/util/setMessageBoxResponse.ts | 4 ++-- packages/app-desktop/package.json | 2 +- packages/app-desktop/tools/electronRebuild.js | 2 +- yarn.lock | 10 +++++----- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/app-desktop/bridge.ts b/packages/app-desktop/bridge.ts index a207d6e6c..ea1bfc691 100644 --- a/packages/app-desktop/bridge.ts +++ b/packages/app-desktop/bridge.ts @@ -452,8 +452,7 @@ export class Bridge { return nativeTheme.shouldUseDarkColors; } - // eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied - public addEventListener(name: string, fn: Function) { + public addEventListener(name: string, fn: ()=> void) { if (name === 'nativeThemeUpdated') { nativeTheme.on('updated', fn); } else { diff --git a/packages/app-desktop/gui/NoteTextViewer.tsx b/packages/app-desktop/gui/NoteTextViewer.tsx index debb4451e..20c0d9d15 100644 --- a/packages/app-desktop/gui/NoteTextViewer.tsx +++ b/packages/app-desktop/gui/NoteTextViewer.tsx @@ -232,7 +232,7 @@ export default class NoteTextViewerComponent extends React.Component className="noteTextViewer" ref={this.webviewRef_} style={viewerStyle} - allow='fullscreen=* autoplay=* local-fonts=* encrypted-media=*' + allow='clipboard-write=(self) fullscreen=(self) autoplay=(self) local-fonts=(self) encrypted-media=(self)' allowFullScreen={true} src={`joplin-content://note-viewer/${__dirname}/note-viewer/index.html`} > diff --git a/packages/app-desktop/integration-tests/util/setMessageBoxResponse.ts b/packages/app-desktop/integration-tests/util/setMessageBoxResponse.ts index 9b29af963..8446286d2 100644 --- a/packages/app-desktop/integration-tests/util/setMessageBoxResponse.ts +++ b/packages/app-desktop/integration-tests/util/setMessageBoxResponse.ts @@ -1,9 +1,9 @@ import { ElectronApplication } from '@playwright/test'; -import { BrowserWindow, MessageBoxOptions } from 'electron'; +import { BaseWindow, MessageBoxOptions } from 'electron'; const setMessageBoxResponse = (electronApp: ElectronApplication, responseMatch: RegExp) => { return electronApp.evaluate(async ({ dialog }, responseMatch) => { - type DialogArgsType = [ BrowserWindow, MessageBoxOptions ]|[MessageBoxOptions]; + type DialogArgsType = [ BaseWindow, MessageBoxOptions ]|[MessageBoxOptions]; const getMatchingButton = (dialogArgs: DialogArgsType) => { const matchingButton = (options: MessageBoxOptions) => { diff --git a/packages/app-desktop/package.json b/packages/app-desktop/package.json index d5d6a2d53..74faf988b 100644 --- a/packages/app-desktop/package.json +++ b/packages/app-desktop/package.json @@ -137,7 +137,7 @@ "@types/styled-components": "5.1.32", "@types/tesseract.js": "2.0.0", "axios": "^1.7.7", - "electron": "29.4.5", + "electron": "32.2.0", "electron-builder": "24.13.3", "glob": "10.4.5", "gulp": "4.0.2", diff --git a/packages/app-desktop/tools/electronRebuild.js b/packages/app-desktop/tools/electronRebuild.js index d4cd7ee6e..875aa9cd5 100644 --- a/packages/app-desktop/tools/electronRebuild.js +++ b/packages/app-desktop/tools/electronRebuild.js @@ -25,7 +25,7 @@ async function main() { // wrong one. However it means it will have to be manually upgraded for each // new Electron release. Some ABI map there: // https://github.com/electron/node-abi/tree/master/test - const forceAbiArgs = '--force-abi 122'; + const forceAbiArgs = '--force-abi 128'; if (isWindows()) { // Cannot run this in parallel, or the 64-bit version might end up diff --git a/yarn.lock b/yarn.lock index 53c45caae..1e25c94c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7411,7 +7411,7 @@ __metadata: compare-versions: 6.1.1 countable: 3.0.1 debounce: 1.2.1 - electron: 29.4.5 + electron: 32.2.0 electron-builder: 24.13.3 electron-updater: 6.2.1 electron-window-state: 5.0.3 @@ -21149,16 +21149,16 @@ __metadata: languageName: node linkType: hard -"electron@npm:29.4.5": - version: 29.4.5 - resolution: "electron@npm:29.4.5" +"electron@npm:32.2.0": + version: 32.2.0 + resolution: "electron@npm:32.2.0" dependencies: "@electron/get": ^2.0.0 "@types/node": ^20.9.0 extract-zip: ^2.0.1 bin: electron: cli.js - checksum: 8c90671ddbde19e3bb4a5e0544e42204b13d1d75f4f96343b400754956a750262c1ad9574f479c0c3b7e90444e675f40a3f61e5374a8bb6f6de45eb6417a7f4f + checksum: c8ae07d9cf361b1aa6fd0726d1acb78e47ba8b821f62a007b3c56764861e598428a806ed14e288278f89a013598bde38d24ecccfccd09d26e84f6770d7e7717c languageName: node linkType: hard