Changes between Initial Version and Version 1 of Ticket #3671


Ignore:
Timestamp:
02/19/2016 06:38:10 PM (4 years ago)
Author:
sebastian
Comment:

Thanks for bringing this up! Just recently, I thought myself about turning abp2blocklist more into an API. However, in particular considering how that code would be used in Adblock Plus for Safari, it makes more sense to have the API expect a sequence of parsed filters rather than plain text. I updated the description accordingly.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3671

    • Property Priority changed from Unknown to P3
    • Property Ready set
    • Property Summary changed from [abp2blocklist] Don't assume code is being called from node.js to [abp2blocklist] Turn the command line interface into an API
  • Ticket #3671 – Description

    initial v1  
    11=== Background === 
    2 Currently we use `abp2blocklist.js` by calling it from the command line using node.js. The script then uses [https://nodejs.org/api/all.html#all_readline the node.js readline] module to pipe the input, and when finished simply uses `console.log` to output the result. 
     2Currently we use `abp2blocklist.js` by calling it from the command line using node.js. The script then uses [https://nodejs.org/api/all.html#all_readline the node.js readline] module to pipe the input, and when finished simply uses `console.log` to output the result. In the future, however, `abp2blocklist` won't always be used in a node.js environment and it won't always be used from the command line. 
    33 
    44=== What to change === 
    5 In the future we won't always be using the script from node.js and it won't always be used from the command line. Separate the logic for converting the rules to produce the block list from the node.js specific command line interaction code. 
     5Separate the logic for converting the rules to produce the block list from the node.js specific command line interaction code. 
    66 
    7 Provide a function that accepts the text of one or more Adblock Plus filter lists as a string / array of strings and returns the content blocking rules as JSON. 
     7Provide a module, which can be used in node.js and other JavaScript envrionments, that exposes an API to convert a sequence of Adblock Plus `Filter` instances to an array of WebKit blocking rules. 
    88 
    9 Modify the existing node.js script to make use of this function. 
     9Modify the existing node.js script to make use of this API.