Disable all webviews, since we never intend to create them (#2114)

This commit is contained in:
Scott Nonnenberg 2018-03-14 14:23:24 -07:00 committed by Scott Nonnenberg
parent 8bd37b7f8d
commit 6e86bf238e
1 changed files with 7 additions and 0 deletions

View File

@ -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);
});