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

code review re. #116

This commit is contained in:
gorhill 2014-07-29 21:10:00 -04:00
parent b100ff5810
commit 11302c6290
2 changed files with 5 additions and 8 deletions

View File

@ -1373,6 +1373,10 @@ FilterContainer.prototype.match3rdPartyHostname = function(requestHostname) {
// Specialized handlers // Specialized handlers
// https://github.com/gorhill/uBlock/issues/116
// Some type of requests are exceptional, they need custom handling,
// not the generic handling.
FilterContainer.prototype.matchStringExactType = function(pageDetails, requestURL, requestType, requestHostname) { FilterContainer.prototype.matchStringExactType = function(pageDetails, requestURL, requestType, requestHostname) {
var url = requestURL.toLowerCase(); var url = requestURL.toLowerCase();
var pageDomain = pageDetails.pageDomain || ''; var pageDomain = pageDetails.pageDomain || '';
@ -1419,13 +1423,6 @@ FilterContainer.prototype.matchStringExactType = function(pageDetails, requestUR
FilterContainer.prototype.matchString = function(pageDetails, requestURL, requestType, requestHostname) { FilterContainer.prototype.matchString = function(pageDetails, requestURL, requestType, requestHostname) {
// adbProfiler.countUrl(); // adbProfiler.countUrl();
// https://github.com/gorhill/uBlock/issues/116
// Some type of requests are exceptional, they need custom handling,
// not the generic handling.
if ( requestType === 'popup' ) {
return this.matchStringExactType(pageDetails, requestURL, requestType, requestHostname);
}
// https://github.com/gorhill/httpswitchboard/issues/239 // https://github.com/gorhill/httpswitchboard/issues/239
// Convert url to lower case: // Convert url to lower case:
// `match-case` option not supported, but then, I saw only one // `match-case` option not supported, but then, I saw only one

View File

@ -152,7 +152,7 @@ var onBeforeSendHeaders = function(details) {
// in multiple tabs. // in multiple tabs.
var reason = false; var reason = false;
if ( µb.getNetFilteringSwitch(pageStore.pageHostname) ) { if ( µb.getNetFilteringSwitch(pageStore.pageHostname) ) {
reason = µb.abpFilters.matchString( reason = µb.abpFilters.matchStringExactType(
pageDetails, pageDetails,
requestURL, requestURL,
'popup', 'popup',