Changes between Initial Version and Version 2 of Ticket #6939


Ignore:
Timestamp:
09/10/2018 05:03:33 PM (13 months ago)
Author:
mjethani
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6939

    • Property Cc hfiguiere sebastian added
  • Ticket #6939 – Description

    initial v2  
    1414=== Expected behaviour === 
    1515Since `com` isn't a valid domain as per the restrictions (which may be changed as part of resolving this issue, by the way), it should consistently not be allowed in element hiding emulation and snippet filters. At the very least the filter should not be applied on unrelated domains like eyeo.com. Even better, the filter should be considered invalid. 
     16 
     17=== Additional notes === 
     18The no-TLD restriction doesn't work for suffixes like `.co.in`, for example, nor does it work for filters like `com,example.com#$#bad-snippet` as this issues shows. 
     19 
     20There are a couple of ways to address this: 
     21 
     22 1.  Add an additional check for TLDs in `ContentFilter.fromText`; this additional check would reject any filters containing a TLD, like the one in this issue (unless it's `localhost`, see #6931); unfortunately this would also likely slow down the loading of the filters. 
     23 2.  Don't check for TLDs in `ContentFilter.fromText`, but instead, do one of the following: (1) do the check at the time of looking up the filters in `Snippets.getFiltersForDomain`, etc.; (2) check for well-known [https://publicsuffix.org/ public suffixes] instead, also in `Snippets.getFiltersForDomain`, etc; (3) don't check anything anywhere.