1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-01 16:33:06 +01:00

better reporting of switch events in the logger

This commit is contained in:
gorhill 2015-04-25 00:28:30 -04:00
parent d8fcc629bb
commit bcbc06b2ff
3 changed files with 4 additions and 2 deletions

View File

@ -104,6 +104,7 @@ HnSwitches.toBroaderHostname = toBroaderHostname;
HnSwitches.prototype.reset = function() { HnSwitches.prototype.reset = function() {
this.switches = {}; this.switches = {};
this.z = '';
}; };
/******************************************************************************/ /******************************************************************************/
@ -229,6 +230,7 @@ HnSwitches.prototype.evaluateZ = function(switchName, hostname) {
if ( bits !== 0 ) { if ( bits !== 0 ) {
bits = bits >> bitOffset & 3; bits = bits >> bitOffset & 3;
if ( bits !== 0 ) { if ( bits !== 0 ) {
this.z = s;
return bits === 1; return bits === 1;
} }
} }

View File

@ -452,7 +452,7 @@ vAPI.tabs.onPopup = function(details) {
// Check user switch first // Check user switch first
if ( µb.hnSwitches.evaluateZ('no-popups', openerHostname) ) { 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 // https://github.com/chrisaljoudi/uBlock/issues/323

View File

@ -161,7 +161,7 @@ var onBeforeRootFrameRequest = function(details) {
// Permanently unrestricted? // Permanently unrestricted?
if ( result === '' && µb.hnSwitches.evaluateZ('no-strict-blocking', requestHostname) ) { 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? // Temporarily whitelisted?