How to use the @cliqz/adblocker.FiltersEngine.deserialize 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 dot-browser / desktop / src / main / services / web-request.ts View on Github external
readFile(resolve(path), (err, buffer) => {
      if (err) return console.error(err);

      engine = FiltersEngine.deserialize(buffer);

      /*const { networkFilters, cosmeticFilters } = parseFilters(
        data,
        engine.config,
      );

      engine.update({
        newNetworkFilters: networkFilters,
        newCosmeticFilters: cosmeticFilters,
      });*/
    });
  }
github wexond / desktop / src / main / services / web-request.ts View on Github external
readFile(resolve(path), (err, buffer) => {
      if (err) return console.error(err);

      try {
        engine = FiltersEngine.deserialize(buffer);
      } catch (e) {
        downloadFilters();
      }

      /*const { networkFilters, cosmeticFilters } = parseFilters(
        data,
        engine.config,
      );

      engine.update({
        newNetworkFilters: networkFilters,
        newCosmeticFilters: cosmeticFilters,
      });*/
    });
  } else {
github cliqz-oss / adblocker / packages / adblocker-benchmarks / blockers / cliqz-base.js View on Github external
deserialize(serialized) {
    this.engine = FiltersEngine.deserialize(serialized);
  }
github cliqz-oss / adblocker / bench / micro.ts View on Github external
export function benchEngineDeserialization({
  serialized,
}: {
  serialized: Uint8Array | undefined;
}): FiltersEngine | undefined {
  if (serialized !== undefined) {
    return FiltersEngine.deserialize(serialized);
  }
  return undefined;
}