1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 16:47:15 +02:00
This commit is contained in:
gorhill 2014-12-22 14:48:17 -05:00
parent 2c7d75c868
commit e904e96d4d

View File

@ -108,20 +108,19 @@ var matchWhitelistDirective = function(url, hostname, directive) {
var targetHostname = this.URI.hostnameFromURI(targetURL);
var key = targetHostname;
var directive = scope === 'page' ? targetURL : targetHostname;
var buckets;
// Add to directive list
if ( newState === false ) {
if ( netWhitelist.hasOwnProperty(key) === false ) {
buckets = netWhitelist[key] = [];
netWhitelist[key] = [];
}
buckets.push(directive);
netWhitelist[key].push(directive);
this.saveWhitelist();
return true;
}
// Remove from directive list whatever causes current URL to be whitelisted
var i;
var buckets, i;
for (;;) {
if ( netWhitelist.hasOwnProperty(key) ) {
buckets = netWhitelist[key];