Skip to content

Commit 1ca24d1

Browse files
committed
Open all links except identity in browser
1 parent e405160 commit 1ca24d1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

main.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { app, BrowserWindow } = require('electron')
1+
const { app, BrowserWindow, shell } = require('electron')
22

33
// setup auto updates
44
require('update-electron-app')()
@@ -9,10 +9,24 @@ function createWindow () {
99
height: 900,
1010
webPreferences: {
1111
devTools: true,
12+
contextIsolation: false,
1213
}
1314
})
1415

1516
win.loadURL("https://bitclout.com");
17+
18+
win.on('page-title-updated', (evt) => {
19+
evt.preventDefault();
20+
});
21+
22+
win.webContents.on('new-window', function(e, url) {
23+
if (url.startsWith('https://identity.bitclout.com')) {
24+
return;
25+
}
26+
27+
e.preventDefault();
28+
shell.openExternal(url);
29+
});
1630
}
1731

1832
app.whenReady().then(() => {

0 commit comments

Comments
 (0)