mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Merge branch 'stable'
This commit is contained in:
commit
983d3f2cc5
11
index.js
11
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;
|
||||
|
||||
@ -38,6 +39,16 @@ function createMainWindow() {
|
||||
}
|
||||
});
|
||||
|
||||
// prevent drag & drop to navigate away from trilium
|
||||
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