Opened 3 years ago

Closed 3 years ago

#3671 closed change (fixed)

[abp2blocklist] Turn the command line interface into an API

Reported by: kzar Assignee: kzar
Priority: P2 Milestone:
Module: Platform Keywords:
Cc: sebastian Blocked By:
Blocking: #3675, #3687 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29336753/

Description (last modified by sebastian)

Background

Currently we use abp2blocklist.js by calling it from the command line using node.js. The script then uses 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.

What to change

Separate the logic for converting the rules to produce the block list from the node.js specific command line interaction code.

Provide 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.

Modify the existing node.js script to make use of this API.

Change History (8)

comment:1 Changed 3 years ago by sebastian

  • Description modified (diff)
  • Priority changed from Unknown to P3
  • Ready set
  • Summary changed from [abp2blocklist] Don't assume code is being called from node.js to [abp2blocklist] Turn the command line interface into an API

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.

comment:2 Changed 3 years ago by kzar

  • Owner set to kzar

comment:3 Changed 3 years ago by kzar

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed 3 years ago by kzar

  • Review URL(s) modified (diff)

comment:5 Changed 3 years ago by sebastian

  • Blocking 3675 added

comment:6 Changed 3 years ago by sebastian

  • Blocking 3687 added

comment:7 Changed 3 years ago by sebastian

  • Priority changed from P3 to P2

Increasing priority, as it is blocking another P2 issue.

comment:8 Changed 3 years ago by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.