Index: lib/matcher.js
===================================================================
--- a/lib/matcher.js
+++ b/lib/matcher.js
@@ -169,20 +169,29 @@
                    specificOnly)
   {
     let set = this.filterByKeyword.get(keyword);
     if (typeof set == "undefined")
       return null;
 
     for (let filter of set)
     {
+      if (typeMask == 0)
+        continue;
+
       if (specificOnly && filter.isGeneric() &&
           !(filter instanceof WhitelistFilter))
         continue;
 
+      if (!sitekey || !docDomain || !thirdParty)
+      {
+        if (filter.matches(location))
+          return filter;
+      }
+
       if (filter.matches(location, typeMask, docDomain, thirdParty, sitekey))
         return filter;
     }
     return null;
   }
 
   /**
    * Tests whether the URL matches any of the known filters
