1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-05 18:32:30 +01:00

expand very simple func in-place

This commit is contained in:
gorhill 2014-08-14 20:00:44 -04:00
parent 6bca38d4dd
commit cf135fa736

View File

@ -457,7 +457,11 @@ FilterContainer.prototype.add = function(s) {
if ( hostname.charAt(0) !== '~' ) {
applyGlobally = false;
}
this.addSpecificSelector(hostname, parsed);
if ( hostname.slice(-2) === '.*' ) {
this.addEntitySelector(hostname, parsed);
} else {
this.addHostnameSelector(hostname, parsed);
}
}
if ( applyGlobally ) {
this.addGenericSelector(parsed);
@ -490,17 +494,6 @@ FilterContainer.prototype.addGenericSelector = function(parsed) {
/******************************************************************************/
FilterContainer.prototype.addSpecificSelector = function(hostname, parsed) {
// rhill 2014-07-13: new filter class: entity.
if ( hostname.slice(-2) === '.*' ) {
this.addEntitySelector(hostname, parsed);
} else {
this.addHostnameSelector(hostname, parsed);
}
};
/******************************************************************************/
FilterContainer.prototype.addHostnameSelector = function(hostname, parsed) {
// https://github.com/gorhill/uBlock/issues/145
var unhide = parsed.unhide;