From 2a626fa3968f4b248a218e0927969bbc6e2a52cf Mon Sep 17 00:00:00 2001 From: Max Goodhart Date: Sat, 20 Jun 2020 22:50:57 -0700 Subject: [PATCH] Prevent permission requests from web content --- src/node/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/node/index.js b/src/node/index.js index 96dcfab..51683c2 100644 --- a/src/node/index.js +++ b/src/node/index.js @@ -1,6 +1,6 @@ import fs from 'fs' import yargs from 'yargs' -import { app, shell, BrowserWindow } from 'electron' +import { app, shell, session, BrowserWindow } from 'electron' import { pollPublicData, pollSpreadsheetData, StreamIDGenerator } from './data' import StreamWindow from './StreamWindow' @@ -49,6 +49,13 @@ async function main() { }) .help().argv + // Reject all permission requests from web content. + session + .fromPartition('persist:session') + .setPermissionRequestHandler((webContents, permission, callback) => { + callback(false) + }) + const idGen = new StreamIDGenerator() const streamWindow = new StreamWindow()