diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-04-19 15:57:16 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-09-30 14:25:48 +0200 |
| commit | 1333c8968e86570b9205bca5d7abf1eacae5812e (patch) | |
| tree | 6aa8bbbb422caa289accbcc62b20673caf109424 /gui/src | |
| parent | 34d2d5c0cd38696f97275027147cc3a0d9e6164a (diff) | |
| download | mullvadvpn-1333c8968e86570b9205bca5d7abf1eacae5812e.tar.xz mullvadvpn-1333c8968e86570b9205bca5d7abf1eacae5812e.zip | |
Deny window open requests
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/index.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 4741965d22..8c0a003074 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -438,8 +438,8 @@ class ApplicationMain { this.blockPermissionRequests(); // Blocks any http(s) and file requests that aren't supposed to happen. this.blockRequests(); - // Blocks navigation since it's not needed. - this.blockNavigation(); + // Blocks navigation and window.open since it's not needed. + this.blockNavigationAndWindowOpen(); this.updateCurrentLocale(); @@ -1648,11 +1648,11 @@ class ApplicationMain { ); } - private blockNavigation() { + // Blocks navigation and window.open since it's not needed. + private blockNavigationAndWindowOpen() { app.on('web-contents-created', (_event, contents) => { - contents.on('will-navigate', (event) => { - event.preventDefault(); - }); + contents.on('will-navigate', (event) => event.preventDefault()); + contents.setWindowOpenHandler(() => ({ action: 'deny' })); }); } |
