Fix "Open in new window" context menu action in release builds (#2873)

* Fix "Open in new window" context menu action in release builds

* Better check and add comment
This commit is contained in:
absidue 2022-11-21 22:29:24 +01:00 committed by GitHub
parent c3f3881f76
commit c8d37cd552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,8 @@ function runApp() {
},
{
label: 'Open in a New Window',
visible: parameters.linkURL.includes((new URL(browserWindow.webContents.getURL())).origin),
// Only show the option for in-app URLs and not external ones
visible: parameters.linkURL.split('#')[0] === browserWindow.webContents.getURL().split('#')[0],
click: () => {
createWindow({ replaceMainWindow: false, windowStartupUrl: parameters.linkURL, showWindowNow: true })
}