From 6e86bf238e7819faf472df8e3e18dcf8e7aac67e Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 14 Mar 2018 14:23:24 -0700 Subject: [PATCH] Disable all webviews, since we never intend to create them (#2114) --- main.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.js b/main.js index 0ea657e45..874355082 100644 --- a/main.js +++ b/main.js @@ -497,6 +497,13 @@ app.on('activate', () => { } }); +// Defense in depth. We never intend to open webviews, so this prevents it completely. +app.on('web-contents-created', (createEvent, win) => { + win.on('will-attach-webview', (attachEvent) => { + attachEvent.preventDefault(); + }); +}); + ipc.on('set-badge-count', (event, count) => { app.setBadgeCount(count); });