How to use the @cliqz/adblocker.FiltersEngine function in @cliqz/adblocker

To help you get started, we’ve selected a few @cliqz/adblocker 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 / bench / dataset / create_list.js View on Github external
function createEngine(lists, resources) {
  const engine = new adblocker.FiltersEngine({
    enableOptimizations: false,
    loadCosmeticFilters: true,
    loadNetworkFilters: true,
    optimizeAOT: false,
    version: 1,
  });

  engine.onUpdateResource([{ filters: resources, checksum: '' }]);
  const serialized = engine.onUpdateFilters(
    lists.map((filters, i) => ({
      asset: `${i}`,
      checksum: '',
      filters,
    })),
    new Set(),
    true,