Prevent permission requests from web content

This commit is contained in:
Max Goodhart
2020-06-20 22:50:57 -07:00
parent 3c488cf379
commit 2a626fa396

View File

@@ -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()