1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00

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,
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);