Skip to content

Commit c8d37cd

Browse files
authored
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
1 parent c3f3881 commit c8d37cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ function runApp() {
3131
},
3232
{
3333
label: 'Open in a New Window',
34-
visible: parameters.linkURL.includes((new URL(browserWindow.webContents.getURL())).origin),
34+
// Only show the option for in-app URLs and not external ones
35+
visible: parameters.linkURL.split('#')[0] === browserWindow.webContents.getURL().split('#')[0],
3536
click: () => {
3637
createWindow({ replaceMainWindow: false, windowStartupUrl: parameters.linkURL, showWindowNow: true })
3738
}

0 commit comments

Comments
 (0)