this will allow to add "tucows downloads"

This commit is contained in:
gorhill 2015-07-11 17:40:42 -04:00
parent 1ac3d61427
commit abb89fd037

View file

@ -160,7 +160,7 @@ var onBeforeRootFrameRequest = function(details) {
pageDomain: requestDomain, pageDomain: requestDomain,
requestURL: requestURL, requestURL: requestURL,
requestHostname: requestHostname, requestHostname: requestHostname,
requestType: 'main_frame' requestType: 'other'
}; };
var result = ''; var result = '';
@ -179,20 +179,20 @@ var onBeforeRootFrameRequest = function(details) {
if ( result === '' ) { if ( result === '' ) {
result = isTemporarilyWhitelisted(result, requestHostname); result = isTemporarilyWhitelisted(result, requestHostname);
if ( result.charAt(1) === 'a' ) { if ( result.charAt(1) === 'a' ) {
result = 'ua:no-strict-blocking on(temporary)'; result = 'ua:no-strict-blocking true (temporary)';
} }
} }
// Filtering // Filtering
if ( result === '' ) { var snfe = µb.staticNetFilteringEngine;
if ( µb.staticNetFilteringEngine.matchString(context) !== undefined ) { if ( result === '' && snfe.matchString(context) !== undefined ) {
// We always need the long-form result here. // We always need the long-form result here.
result = µb.staticNetFilteringEngine.toResultString(true); result = snfe.toResultString(true);
// https://github.com/chrisaljoudi/uBlock/issues/1128 // https://github.com/chrisaljoudi/uBlock/issues/1128
// Do not block if the match begins after the hostname. // Do not block if the match begins after the hostname, except when
if ( result.charAt(1) === 'b' ) { // the filter is specifically of type `other`.
result = toBlockDocResult(requestURL, requestHostname, result); if ( result.charAt(1) === 'b' && (snfe.keyRegister & 0xF0) !== 0x80 ) {
} result = toBlockDocResult(requestURL, requestHostname, result);
} }
} }
@ -227,7 +227,7 @@ var onBeforeRootFrameRequest = function(details) {
hn: requestHostname, hn: requestHostname,
dn: requestDomain, dn: requestDomain,
fc: compiled, fc: compiled,
fs: µb.staticNetFilteringEngine.filterStringFromCompiled(compiled) fs: snfe.filterStringFromCompiled(compiled)
})); }));
vAPI.tabs.replace(tabId, vAPI.getURL('document-blocked.html?details=') + query); vAPI.tabs.replace(tabId, vAPI.getURL('document-blocked.html?details=') + query);