From bcbc06b2ff5a7c1c170b452ca7c6cb171927ea76 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 25 Apr 2015 00:28:30 -0400 Subject: [PATCH] better reporting of switch events in the logger --- src/js/hnswitches.js | 2 ++ src/js/tab.js | 2 +- src/js/traffic.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/hnswitches.js b/src/js/hnswitches.js index 1ae3de10c..cd1317773 100644 --- a/src/js/hnswitches.js +++ b/src/js/hnswitches.js @@ -104,6 +104,7 @@ HnSwitches.toBroaderHostname = toBroaderHostname; HnSwitches.prototype.reset = function() { this.switches = {}; + this.z = ''; }; /******************************************************************************/ @@ -229,6 +230,7 @@ HnSwitches.prototype.evaluateZ = function(switchName, hostname) { if ( bits !== 0 ) { bits = bits >> bitOffset & 3; if ( bits !== 0 ) { + this.z = s; return bits === 1; } } diff --git a/src/js/tab.js b/src/js/tab.js index ef44a3334..c84f6faf6 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -452,7 +452,7 @@ vAPI.tabs.onPopup = function(details) { // Check user switch first if ( µb.hnSwitches.evaluateZ('no-popups', openerHostname) ) { - result = 'ub:no-popups true'; + result = 'ub:no-popups: ' + µb.hnSwitches.z + ' true'; } // https://github.com/chrisaljoudi/uBlock/issues/323 diff --git a/src/js/traffic.js b/src/js/traffic.js index 6530eb921..666122529 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -161,7 +161,7 @@ var onBeforeRootFrameRequest = function(details) { // Permanently unrestricted? if ( result === '' && µb.hnSwitches.evaluateZ('no-strict-blocking', requestHostname) ) { - result = 'ua:no-strict-blocking on'; + result = 'ua:no-strict-blocking: ' + µb.hnSwitches.z + ' true'; } // Temporarily whitelisted?