mirror of https://github.com/keeweb/keeweb
preventing navigation in the main window
parent
c5298242f6
commit
05b2b395ad
|
@ -297,6 +297,7 @@ Events.on('launcher-exit-request', () => {
|
|||
Events.on('launcher-minimize', () => setTimeout(() => Events.emit('app-minimized'), 0));
|
||||
Events.on('launcher-started-minimized', () => setTimeout(() => Launcher.minimizeApp(), 0));
|
||||
Events.on('start-profile', data => StartProfiler.reportAppProfile(data));
|
||||
Events.on('log', e => new Logger(e.category || 'remote-app')[e.method || 'info'](e.message));
|
||||
|
||||
window.launcherOpen = file => Launcher.openFile(file);
|
||||
if (window.launcherOpenedFile) {
|
||||
|
|
|
@ -236,6 +236,12 @@ function createMainWindow() {
|
|||
mainWindow.on('session-end', () => {
|
||||
emitRemoteEvent('os-lock');
|
||||
});
|
||||
mainWindow.webContents.on('will-navigate', (e, url) => {
|
||||
if (!url.startsWith('https://beta.keeweb.info/')) {
|
||||
emitRemoteEvent('log', { message: `Prevented navigation: ${url}` });
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
perfTimestamps &&
|
||||
perfTimestamps.push({ name: 'configuring main window', ts: process.hrtime() });
|
||||
|
||||
|
|
Loading…
Reference in New Issue