Merge branch 'stable'

This commit is contained in:
azivner 2018-01-12 20:15:33 -05:00
commit 983d3f2cc5

View File

@ -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;
}