disabled navigation in desktop

This commit is contained in:
antelle 2020-04-17 21:54:34 +02:00
parent 6d781a6358
commit 3a042f25c2
No known key found for this signature in database
GPG Key ID: 094A2F2D6136A4EE
1 changed files with 6 additions and 6 deletions

View File

@ -109,6 +109,12 @@ app.on('web-contents-created', (event, contents) => {
e.preventDefault();
emitRemoteEvent('log', { message: `Prevented new window: ${url}` });
});
contents.on('will-navigate', (e, url) => {
if (!url.startsWith('https://beta.keeweb.info/') && !url.startsWith(htmlPath)) {
e.preventDefault();
emitRemoteEvent('log', { message: `Prevented navigation: ${url}` });
}
});
});
app.restartApp = function() {
restartPending = true;
@ -239,12 +245,6 @@ function createMainWindow() {
mainWindow.on('session-end', () => {
emitRemoteEvent('os-lock');
});
mainWindow.webContents.on('will-navigate', (e, url) => {
if (!url.startsWith('https://beta.keeweb.info/') && !url.startsWith(htmlPath)) {
e.preventDefault();
emitRemoteEvent('log', { message: `Prevented navigation: ${url}` });
}
});
perfTimestamps &&
perfTimestamps.push({ name: 'configuring main window', ts: process.hrtime() });