From e0a567a89f0987f898e628cfb51b3bf7524c55fd Mon Sep 17 00:00:00 2001 From: sose Date: Mon, 26 Apr 2021 21:50:53 -0700 Subject: [PATCH] block permission and popup requests --- hellgate.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hellgate.js b/hellgate.js index eb4a78d..b387799 100644 --- a/hellgate.js +++ b/hellgate.js @@ -55,7 +55,16 @@ async function handle_request(request, response) { var page_sigil var data = "" var available_sigils = fs.readdirSync(sigils_dir) - + + win.webContents.session.setPermissionRequestHandler((webContents, permission, callback) => { + return callback(false) + }) + + win.webContents.setWindowOpenHandler(() => { + console.log("Blocked a popup request") + return {action: 'deny'} + }) + console.log(`Got request for "${target_url}"`) await Promise.race([