Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit 3bc0599

Browse files
committed
Fixed bugs related to changes for #276
1 parent fded043 commit 3bc0599

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

js/abp-hide-filters.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ var FilterParser = function() {
170170
this.hostnames = [];
171171
this.invalid = false;
172172
this.unsupported = false;
173-
this.rePlain = /([#.][\w-]+)$/;
173+
this.rePlain = /^([#.][\w-]+)/;
174174
this.rePlainMore = /^[#.][\w-]+[^\w-]/;
175175
};
176176

@@ -380,8 +380,8 @@ FilterContainer.prototype.addPlainMoreHostnameFilter = function(parsed) {
380380
continue;
381381
}
382382
f = new FilterPlainMoreHostname(parsed.f, hostname);
383-
hash = this.makeHash(parsed.filterType, parsed.f, httpsburi.domainFromHostname(hostname));
384-
this.addFilterEntry(hash, plainSelector);
383+
hash = this.makeHash(parsed.filterType, plainSelector, httpsburi.domainFromHostname(hostname));
384+
this.addFilterEntry(hash, f);
385385
}
386386
};
387387

@@ -416,18 +416,15 @@ FilterContainer.prototype.retrieve = function(url, inSelectors) {
416416
continue;
417417
}
418418
hash = this.makeHash('#', selector);
419-
bucket = this.filters[hash];
420-
if ( bucket ) {
419+
if ( bucket = this.filters[hash] ) {
421420
bucket.retrieve(selector, hideSelectors);
422421
}
423422
hash = this.makeHash('#', selector, domain);
424-
bucket = this.filters[hash];
425-
if ( bucket ) {
423+
if ( bucket = this.filters[hash] ) {
426424
bucket.retrieve(selector, hideSelectors);
427425
}
428426
hash = this.makeHash('@', selector, domain);
429-
bucket = this.filters[hash];
430-
if ( bucket ) {
427+
if ( bucket = this.filters[hash] ) {
431428
bucket.retrieve(selector, donthideSelectors);
432429
}
433430
}

0 commit comments

Comments
 (0)