Changes between Version 6 and Version 21 of Ticket #7003

10/23/2018 11:18:24 AM (2 years ago)


  • Ticket #7003

    • Property Summary changed from Implement alternative filter matching algorithm returning a boolean value to Implement alternative filter matching algorithm deprioritizing whitelist filters
    • Property Owner set to mjethani
    • Property Blocking changed from to 7000
  • Ticket #7003 – Description

    v6 v21  
    5454The extension is not really interested in whitelist filters unless DevTools is open. It simply wants to know whether a URL should be blocked or not. Technically, a whitelist filter should be considered a "hit" only if it actually prevented a URL from being blocked. 
    56 [TBD: What to do] 
     56=== What to change === 
     57Modify the implementation of `CombinedMatcher.prototype.matchesAny` in `lib/matcher.js` so that it doesn't look up any whitelist filters unless a matching blocking filter is found. This should not apply when the type mask contains one of the whitelist-only types `$document`, `$elemhide`, `$generichide`, and `$genericblock`; in these cases, the lookup should always be in the set of whitelist filters. 
    58 === What to change === 
    59 [TBD] 
     59=== Integration notes === 
     60`CombinedMatcher.prototype.matchesAny` now returns a whitelist filter for types other than `$document`, `$elemhide`, `$generichide`, and `$genericblock` only if there is also at least one corresponding blocking filter matching the request. For example, if there is a whitelist filter `@@||^$script` and no blocking filter for `` URLs, the function will return `null`; but if there is also a blocking filter `/foo^$script` then for the URL `` the function will return the whitelist filter `@@||^$script`. 
     62The function has been optimized for whitelist-only types like `$genericblock` so for these types it should be called directly instead of being called on the internal `whitelist` property, which does not cache the result (and is going to be made private in #6940).