This commit is contained in:
gorhill 2016-06-06 09:11:27 -04:00
parent e177e04f90
commit a5ecf2ed68
1 changed files with 1 additions and 10 deletions

View File

@ -133,23 +133,13 @@ var fromCosmeticFilter = function(details) {
// Second step: find hostname-based versions.
// Reference: FilterContainer.compileHostnameSelector().
var pos;
var domain = details.domain;
var hostname = details.hostname;
if ( hostname !== '' ) {
for ( ;; ) {
candidates[hostname + '##' + filter] = new RegExp(
['c', 'h', '\\w+', reEscape(hostname), reEscape(filter)].join('\\v') +
'(?:\\n|$)'
);
// If there is no valid domain, there won't be any other
// version of this hostname-based filter.
if ( domain === '' ) {
break;
}
if ( hostname === domain ) {
break;
}
pos = hostname.indexOf('.');
if ( pos === -1 ) {
break;
@ -160,6 +150,7 @@ var fromCosmeticFilter = function(details) {
// Last step: find entity-based versions.
// Reference: FilterContainer.compileEntitySelector().
var domain = details.domain;
pos = domain.indexOf('.');
if ( pos !== -1 ) {
var entity = domain.slice(0, pos);