Changes between Version 1 and Version 2 of Ticket #7338, comment 20


Ignore:
Timestamp:
03/28/2019 10:25:12 PM (18 months ago)
Author:
sebastian
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7338, comment 20

    v1 v2  
    11> - In `lib/filterValidation.js` we use `document.createElement`, `document.documentElement.appendChild`, `document.documentElement.removeChild` and `document.querySelector` to create a `style` element which we use to test if a given CSS selector is valid. No plan so far, we'll need to attempt to validate CSS selectors ourselves - perhaps with a big regexp. 
    22 
    3 Let's just get rid of the `filterValidation` module. If we want to keep validating CSS selectors used in element hiding filters, this needs to be done on the content-side (e.g. in the options page) where we can still access the DOM, but that is up to the UI team. However, with that logic removed, all is left of the `filterValidation` module would be a trivial wrapper around `Filter.fromText()` and `instanceof InvalidFilter`. That code should rather go into `adblockplusui/messageResponder.js`. 
     3Let's just remove the `filterValidation` module. If we want to keep validating CSS selectors used in element hiding filters, this needs to be done on the content-side (e.g. in the options page) where we can still access the DOM, but that is up to the UI team. However, with that logic removed, all is left of the `filterValidation` module would be a trivial wrapper around `Filter.fromText()` and `instanceof InvalidFilter`. There is no reason for `messageResponder.js` to use another module just for that.