1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-01 08:39:37 +02:00

fix dynamic filters in popup exception for built-in web pages

This commit is contained in:
gorhill 2014-10-28 02:02:51 -04:00
parent bd3fabad4a
commit c650654062

View File

@ -58,10 +58,14 @@ var syncDynamicFilter = function(scope, i, result) {
// Use dark shade visual cue if the filter is specific to the page hostname // Use dark shade visual cue if the filter is specific to the page hostname
// or one of the ancestor hostname. // or one of the ancestor hostname.
var ownFilter = false; var ownFilter = false;
var filterHostname = matches[3] || '*'; // There might be no page hostname on pages where uBlock can't be active,
if ( stats.pageHostname.slice(0 - filterHostname.length) === filterHostname ) { // like on browser's built-in pages, etc.
ownFilter = (stats.pageHostname.length === filterHostname.length) || if ( stats.pageHostname ) {
(stats.pageHostname.substr(0 - filterHostname.length - 1, 1) === '.'); 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); el.toggleClass('ownFilter', ownFilter);
}; };