mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +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 electron = require('electron');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const config = require('./services/config');
|
const config = require('./services/config');
|
||||||
|
const url = require("url");
|
||||||
|
|
||||||
const app = electron.app;
|
const app = electron.app;
|
||||||
|
|
||||||
@ -39,8 +40,13 @@ function createMainWindow() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// prevent drag & drop to navigate away from trilium
|
// prevent drag & drop to navigate away from trilium
|
||||||
win.webContents.on('will-navigate', ev => {
|
win.webContents.on('will-navigate', (ev, targetUrl) => {
|
||||||
ev.preventDefault()
|
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;
|
return win;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user