mirror of
https://github.com/bitwarden/browser
synced 2026-02-04 10:43:47 +00:00
Electron 39 test
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
"**/node_modules/@bitwarden/desktop-napi/index.js",
|
||||
"**/node_modules/@bitwarden/desktop-napi/desktop_napi.${platform}-${arch}*.node"
|
||||
],
|
||||
"electronVersion": "37.7.0",
|
||||
"electronVersion": "39.2.6",
|
||||
"generateUpdatesFilesForAllChannels": true,
|
||||
"publish": {
|
||||
"provider": "generic",
|
||||
|
||||
@@ -229,6 +229,8 @@ export class WindowMain {
|
||||
// TODO: REMOVE ONCE WE CAN STOP USING FAKE POP UP BTN FROM TRAY
|
||||
// Only used for development
|
||||
async loadUrl(targetPath: string, modal: boolean = false) {
|
||||
this.logService.info(`Loading url: ${targetPath} in modal mode: ${modal}`);
|
||||
|
||||
if (this.win == null || this.win.isDestroyed()) {
|
||||
await this.createWindow("modal-app");
|
||||
return;
|
||||
@@ -250,9 +252,37 @@ export class WindowMain {
|
||||
userAgent: cleanUserAgent(this.win.webContents.userAgent),
|
||||
},
|
||||
);
|
||||
|
||||
let shownWindow = false;
|
||||
|
||||
this.win.once("ready-to-show", () => {
|
||||
this.logService.info(`Url loaded: ${targetPath}. Showing window. ${shownWindow}`);
|
||||
if (shownWindow) {
|
||||
return;
|
||||
}
|
||||
shownWindow = true;
|
||||
this.win.show();
|
||||
});
|
||||
|
||||
// The `ready-to-show` event doesn't always fire on wayland.
|
||||
// Use the `did-finish-load` event on the web contents instead as that is similar enough
|
||||
// https://github.com/electron/electron/issues/48859
|
||||
|
||||
if (process.env.ENABLE_LINUX_WORKAROUND === "1") {
|
||||
this.logService.info(
|
||||
`Using linux workaround to show window on did-finish-load event for url: ${targetPath}`,
|
||||
);
|
||||
this.win.webContents.once("did-finish-load", () => {
|
||||
this.logService.info(
|
||||
`Using did-finish-load event to show ${targetPath} on linux. Showing window. ${shownWindow}`,
|
||||
);
|
||||
if (shownWindow) {
|
||||
return;
|
||||
}
|
||||
shownWindow = true;
|
||||
this.win.show();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -131,7 +131,7 @@
|
||||
"copy-webpack-plugin": "13.0.1",
|
||||
"cross-env": "10.1.0",
|
||||
"css-loader": "7.1.2",
|
||||
"electron": "37.7.0",
|
||||
"electron": "39.2.6",
|
||||
"electron-builder": "26.0.12",
|
||||
"electron-log": "5.4.3",
|
||||
"electron-reload": "2.0.0-alpha.1",
|
||||
@@ -20563,9 +20563,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/electron": {
|
||||
"version": "37.7.0",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-37.7.0.tgz",
|
||||
"integrity": "sha512-LBzvfrS0aalynOsnC11AD7zeoU8eOois090mzLpQM3K8yZ2N04i2ZW9qmHOTFLrXlKvrwRc7EbyQf1u8XHMl6Q==",
|
||||
"version": "39.2.6",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-39.2.6.tgz",
|
||||
"integrity": "sha512-dHBgTodWBZd+tL1Dt0PSh/CFLHeDkFCTKCTXu1dgPhlE9Z3k2zzlBQ9B2oW55CFsKanBDHiUomHJNw0XaSdQpA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
"copy-webpack-plugin": "13.0.1",
|
||||
"cross-env": "10.1.0",
|
||||
"css-loader": "7.1.2",
|
||||
"electron": "37.7.0",
|
||||
"electron": "39.2.6",
|
||||
"electron-builder": "26.0.12",
|
||||
"electron-log": "5.4.3",
|
||||
"electron-reload": "2.0.0-alpha.1",
|
||||
|
||||
Reference in New Issue
Block a user