We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 559bd72 commit ea6e8b7Copy full SHA for ea6e8b7
src/main/main.ts
@@ -190,10 +190,10 @@ app.on('ready', () => {
190
});
191
192
app.on("web-contents-created", (_event: any, webContents: WebContents) => {
193
- // Prevent navigation to local links
+ // Prevent navigation to local links on the same page and external links
194
webContents.on('will-navigate', (event: Event, navigationUrl) => {
195
const jlabBaseUrl = `http://localhost:${appConfig.jlabPort}/`;
196
- if (navigationUrl.startsWith(jlabBaseUrl) && navigationUrl.indexOf('#') !== -1) {
+ if (!(navigationUrl.startsWith(jlabBaseUrl) && navigationUrl.indexOf('#') === -1)) {
197
console.warn(`Navigation is not allowed; attempted navigation to: ${navigationUrl}`);
198
event.preventDefault();
199
}
0 commit comments