From 53a471b2b1942ae4ae7ef245a97613c763f6033c Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 23 May 2018 16:02:33 -0700 Subject: [PATCH] Expand set of blocked URI schemes --- app/protocol_filter.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/protocol_filter.js b/app/protocol_filter.js index a13414741530..f0e33cc89e68 100644 --- a/app/protocol_filter.js +++ b/app/protocol_filter.js @@ -41,15 +41,26 @@ function installFileHandler({ protocol, userDataPath, installPath }) { ); } -// Turn off all browser web requests since we do all web requests via Node.js -function _webHandler(request, callback) { +// Turn off browser URI scheme since we do all network requests via Node.js +function _disabledHandler(request, callback) { return callback(); } function installWebHandler({ protocol }) { - protocol.interceptFileProtocol('http', _webHandler); - protocol.interceptFileProtocol('https', _webHandler); - protocol.interceptFileProtocol('ftp', _webHandler); + protocol.interceptFileProtocol('about', _disabledHandler); + protocol.interceptFileProtocol('content', _disabledHandler); + protocol.interceptFileProtocol('chrome', _disabledHandler); + protocol.interceptFileProtocol('cid', _disabledHandler); + protocol.interceptFileProtocol('data', _disabledHandler); + protocol.interceptFileProtocol('filesystem', _disabledHandler); + protocol.interceptFileProtocol('ftp', _disabledHandler); + protocol.interceptFileProtocol('gopher', _disabledHandler); + protocol.interceptFileProtocol('http', _disabledHandler); + protocol.interceptFileProtocol('https', _disabledHandler); + protocol.interceptFileProtocol('javascript', _disabledHandler); + protocol.interceptFileProtocol('mailto', _disabledHandler); + protocol.interceptFileProtocol('ws', _disabledHandler); + protocol.interceptFileProtocol('wss', _disabledHandler); } module.exports = {