Closed dtslvr closed 5 years ago
Same here. Here's how it looks.
I found a fix. Will be posting a PR in a few minutes.
While the PR is waiting to be merged, you can use patch-package
and add the following file to your project's patches
folder. Name the file about-window+1.12.1.patch
(or change the version number if you're on some earlier version):
diff --git a/node_modules/about-window/src/index.js b/node_modules/about-window/src/index.js
index 6a3cb6f..7bc8545 100644
--- a/node_modules/about-window/src/index.js
+++ b/node_modules/about-window/src/index.js
@@ -100,6 +100,11 @@ function openAboutWindow(info_or_img_path) {
titleBarStyle: 'hidden-inset',
show: !info.adjust_window_size,
icon: info.icon_path,
+ webPreferences: {
+ // For security reasons, nodeIntegration is no longer true by default when using Electron v5 or later
+ // nodeIntegration can be safely enabled as long as the window source is not remote
+ nodeIntegration: true,
+ },
}, info.win_options || {});
window = new (electron_1.BrowserWindow || electron_1.remote.BrowserWindow)(options);
window.once('closed', () => {
Thanks @Vages ! On my side, I'm gonna use your fork repo while we wait your PR to be merged.
Actually, you can also use the win_options
property when you call the openAboutWindow()
function, and set nodeIntegration to true.
openAboutWindow({
...
win_options: {
webPreferences: {
nodeIntegration: true
}
}
})
win_options | Options of 'About This App' window. It is merged into default options. Optional | BrowserWindow options object
This issue was fixed by v1.13.0. Please update package.
This issue was fixed by v1.13.0. Please update package.
Thanks a lot, @rhysd and @Vages!
I have upgraded to Electron 5.0.1 and located that the about window is broken. There is no text anymore, just the (broken) icon with a "App icon" label".