diff options
author | Mahadevan Sreenivasan <mahadevan_sv@yahoo.com> | 2020-04-29 18:15:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 18:15:46 +0000 |
commit | 5a197d26d364409cb1457c4b30041a8f298fba56 (patch) | |
tree | 3115e8d32be9ed06d1028c9539d8fdef42ce9c99 /src/index.js | |
parent | docs: add gega7 as a contributor (#684) (diff) | |
download | ferdium-app-5a197d26d364409cb1457c4b30041a8f298fba56.tar.gz ferdium-app-5a197d26d364409cb1457c4b30041a8f298fba56.tar.zst ferdium-app-5a197d26d364409cb1457c4b30041a8f298fba56.zip |
Prevent unnecessary electron popup windows for links (#685)
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js index 027884826..85aa9d1b9 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -192,6 +192,14 @@ const createWindow = () => { | |||
192 | }, | 192 | }, |
193 | }); | 193 | }); |
194 | 194 | ||
195 | app.on('web-contents-created', (e, contents) => { | ||
196 | if (contents.getType() === 'webview') { | ||
197 | contents.on('new-window', (event) => { | ||
198 | event.preventDefault(); | ||
199 | }); | ||
200 | } | ||
201 | }); | ||
202 | |||
195 | mainWindow.webContents.on('did-finish-load', () => { | 203 | mainWindow.webContents.on('did-finish-load', () => { |
196 | const fns = onDidLoadFns; | 204 | const fns = onDidLoadFns; |
197 | onDidLoadFns = null; | 205 | onDidLoadFns = null; |