From 751e34f3ceabb2f5aa9fde64d69bb938026af309 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 5 Oct 2016 18:18:32 -0400 Subject: [PATCH] fix #2050 --- src/js/traffic.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/js/traffic.js b/src/js/traffic.js index 7814a910d..9c97dab13 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -451,6 +451,14 @@ var processCSP = function(details, pageStore, context) { µb.staticNetFilteringEngine.matchStringExactType(context, requestURL, 'websocket'); var websocketResult = µb.staticNetFilteringEngine.toResultString(loggerEnabled), blockWebsocket = µb.isBlockResult(websocketResult); + // https://github.com/gorhill/uBlock/issues/2050 + // Blanket-blocking websockets is exceptional, so we test whether the + // page is whitelisted if and only if there is a hit against a websocket + // filter. + if ( blockWebsocket && pageStore.getNetFilteringSwitch() === false ) { + websocketResult = ''; + blockWebsocket = false; + } var headersChanged = false; if ( blockInlineScript || blockWebsocket ) {