This commit is contained in:
gorhill 2014-12-22 14:48:17 -05:00
parent 2c7d75c868
commit e904e96d4d
1 changed files with 3 additions and 4 deletions

View File

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