1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00
This commit is contained in:
gorhill 2014-10-27 12:14:57 -04:00
parent 53593e85f8
commit f3dd2ff748

View File

@ -53,7 +53,16 @@ var syncDynamicFilter = function(scope, i, result) {
var matches = reResultParser.exec(result) || [];
var blocked = matches.length !== 0 && matches[1] !== '@@';
el.toggleClass('blocked', blocked);
var ownFilter = matches[3] !== undefined && matches[3] === stats.pageHostname;
// https://github.com/gorhill/uBlock/issues/340
// Use dark shade visual cue if the filter is specific to the page hostname
// or one of the ancestor hostname.
var ownFilter = false;
var filterHostname = matches[3] || '*';
if ( stats.pageHostname.slice(0 - filterHostname.length) === filterHostname ) {
ownFilter = (stats.pageHostname.length === filterHostname.length) ||
(stats.pageHostname.substr(0 - filterHostname.length - 1, 1) === '.');
}
el.toggleClass('ownFilter', ownFilter);
};