diff options
author | gorhill <rhill@raymondhill.net> | 2015-07-11 17:40:42 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-07-11 17:40:42 -0400 |
commit | abb89fd037eef80ae0c0076fb8d83da9672de3de (patch) | |
tree | fc96fa784f3fdb3c15c1e5fd25000d245ed5f038 /src/js | |
parent | 1ac3d6142760de3812dba7cd8bb481c308587950 (diff) | |
download | uBlock-abb89fd037eef80ae0c0076fb8d83da9672de3de.zip uBlock-abb89fd037eef80ae0c0076fb8d83da9672de3de.tar.gz uBlock-abb89fd037eef80ae0c0076fb8d83da9672de3de.tar.bz2 |
this will allow to add "tucows downloads"
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/traffic.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/js/traffic.js b/src/js/traffic.js index 9a1969c..5a1bb13 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -160,7 +160,7 @@ var onBeforeRootFrameRequest = function(details) { pageDomain: requestDomain, requestURL: requestURL, requestHostname: requestHostname, - requestType: 'main_frame' + requestType: 'other' }; var result = ''; @@ -179,20 +179,20 @@ var onBeforeRootFrameRequest = function(details) { if ( result === '' ) { result = isTemporarilyWhitelisted(result, requestHostname); if ( result.charAt(1) === 'a' ) { - result = 'ua:no-strict-blocking on(temporary)'; + result = 'ua:no-strict-blocking true (temporary)'; } } // Filtering - if ( result === '' ) { - if ( µb.staticNetFilteringEngine.matchString(context) !== undefined ) { - // We always need the long-form result here. - result = µb.staticNetFilteringEngine.toResultString(true); - // https://github.com/chrisaljoudi/uBlock/issues/1128 - // Do not block if the match begins after the hostname. - if ( result.charAt(1) === 'b' ) { - result = toBlockDocResult(requestURL, requestHostname, result); - } + var snfe = µb.staticNetFilteringEngine; + if ( result === '' && snfe.matchString(context) !== undefined ) { + // We always need the long-form result here. + result = snfe.toResultString(true); + // https://github.com/chrisaljoudi/uBlock/issues/1128 + // Do not block if the match begins after the hostname, except when + // the filter is specifically of type `other`. + if ( result.charAt(1) === 'b' && (snfe.keyRegister & 0xF0) !== 0x80 ) { + result = toBlockDocResult(requestURL, requestHostname, result); } } @@ -227,7 +227,7 @@ var onBeforeRootFrameRequest = function(details) { hn: requestHostname, dn: requestDomain, fc: compiled, - fs: µb.staticNetFilteringEngine.filterStringFromCompiled(compiled) + fs: snfe.filterStringFromCompiled(compiled) })); vAPI.tabs.replace(tabId, vAPI.getURL('document-blocked.html?details=') + query); |