How to use the adblock-rs.Engine function in adblock-rs

To help you get started, we’ve selected a few adblock-rs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cliqz-oss / adblocker / packages / adblocker-benchmarks / blockers / brave.js View on Github external
static parse(rawLists) {
    return new Brave(new Engine(rawLists.split(/[\n\r]+/g)));
  }
github brave / brave-core-crx-packager / scripts / generateAdBlockRustDataFiles.js View on Github external
const generateDataFileFromString = (filterRuleData, outputDATFilename, outSubdir) => {
  let rules
  if (filterRuleData.constructor === Array) {
    rules = filterRuleData.join('\n')
  } else {
    rules = filterRuleData
  }
  const client = new Engine(rules.split('\n'))
  const arrayBuffer = client.serialize()
  const outPath = getOutPath(outputDATFilename, outSubdir)
  fs.writeFileSync(outPath, Buffer.from(arrayBuffer))
}

adblock-rs

Very fast, Rust-based, native implementation of ad-blocker engine for Node

MPL-2.0
Latest version published 23 days ago

Package Health Score

79 / 100
Full package analysis