mirror of
https://github.com/zadam/trilium.git
synced 2025-06-05 01:18:44 +02:00
fix for setup & db upgrade - we still need internal redirects
This commit is contained in:
parent
7d456240a8
commit
92271a84b7
10
index.js
10
index.js
@ -2,6 +2,7 @@
|
||||
const electron = require('electron');
|
||||
const path = require('path');
|
||||
const config = require('./services/config');
|
||||
const url = require("url");
|
||||
|
||||
const app = electron.app;
|
||||
|
||||
@ -39,8 +40,13 @@ function createMainWindow() {
|
||||
});
|
||||
|
||||
// prevent drag & drop to navigate away from trilium
|
||||
win.webContents.on('will-navigate', ev => {
|
||||
ev.preventDefault()
|
||||
win.webContents.on('will-navigate', (ev, targetUrl) => {
|
||||
const parsedUrl = url.parse(targetUrl);
|
||||
|
||||
// we still need to allow internal redirects from setup and migration pages
|
||||
if (parsedUrl.hostname !== 'localhost' || (parsedUrl.path && parsedUrl.path !== '/')) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
return win;
|
||||
|
Loading…
x
Reference in New Issue
Block a user