From 98fd49a6cfe660c363aecb6ebe0a4cb69342808d Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 21 Dec 2014 11:49:13 +0000 Subject: Exclusion; show state. --- background_scripts/exclusions.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/exclusions.coffee b/background_scripts/exclusions.coffee index a8d65d62..12d86f41 100644 --- a/background_scripts/exclusions.coffee +++ b/background_scripts/exclusions.coffee @@ -23,9 +23,9 @@ root.Exclusions = Exclusions = rules: Settings.get("exclusionRules") - # Merge the matching rules for URL, or null. - getRule: (url) -> - matching = (rule for rule in @rules when url.match(RegexpCache.get(rule.pattern))) + # Merge the matching rules for URL, or null. If rules are provided, match against those. + getRule: (url, rules=@rules) -> + matching = (rule for rule in rules when rule.pattern and url.match(RegexpCache.get(rule.pattern))) # An absolute exclusion rule (with no passKeys) takes priority. for rule in matching return rule unless rule.passKeys -- cgit v1.2.3