Easylist filters include a ##div-element qualifier which allows matching and removal of elements within a document. Are there plans to support this feature or would this be handled by some code in the extension?
I noticed in the code that there is a comment that "main_frame" should be added to the resource type conditions. The url_pattern_index code contains an "activation" option which seems like a better way to implement this. This would require adding an optional "activation" list to the idl. There are currently two activation types defined: "document" and "generic_block". Both of these really only apply to whitelist rules and should probably be ignored or errored for blacklist rules.
c#64: Not sure I get what you are suggesting. Can you elaborate? The ActivationType in url_pattern_index is used to implement frame-whitelisting ($document) rules. Think the main_frame resource type is orthogonal to this and can be implemented by just adding it as a resource type.
I guess I misunderstood what main_frame would be used for. Is it equal to the inverse of sub_frame? It's not clear to me how it would be derived and used.
Are there plans to support the ActivationTypes? That is something that would be very useful.
Thank you for responding to my request.
Oh ok, yeah we haven't yet decided whether we would want to support these.
Also, if you have been testing/using the API, let me know if you have any other feedback, personally or on email. Thanks.
So far I have been using the easylist as my source of filters. I use a parser to convert the easylist into a filters.json (attached). This conversion works for 25891/40639 of the easylist resource blacklist filters. Also 4464/5578 of the resource whilelist filters can be converted. The easylist has 18848 element hiding rules which DNR will not support.
More rules can be supported with $document, $genericblock, $~document, $~genericblock. But there are a few options (such as popup and generichide) which I believe are outside the scope of DNR.
I am not seeing any performance or memory issues when loading the filters and the blocking does appear to work.
One thing I would like to see would be a separation of the DNR library from the extension api. Some platforms may not support extensions so it might be useful in the future to build filtering functions right into the browser.