How to use the @cliqz/adblocker-content.extractFeaturesFromDOM function in @cliqz/adblocker-content

To help you get started, we’ve selected a few @cliqz/adblocker-content 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-webextension-cosmetics / adblocker.ts View on Github external
const handleNodes = (nodes: Element[]) => {
        const { classes, ids, hrefs } = extractFeaturesFromDOM(nodes);
        const newIds: string[] = [];
        const newClasses: string[] = [];
        const newHrefs: string[] = [];

        // Update ids
        for (let i = 0; i < ids.length; i += 1) {
          const id = ids[i];
          if (knownIds.has(id) === false) {
            newIds.push(id);
            knownIds.add(id);
          }
        }

        for (let i = 0; i < classes.length; i += 1) {
          const cls = classes[i];
          if (knownClasses.has(cls) === false) {
github cliqz-oss / adblocker / packages / adblocker-electron / preload.ts View on Github external
const handleNodes = (nodes: Element[]) => {
        const { classes, ids, hrefs } = extractFeaturesFromDOM(nodes);
        const newIds: string[] = [];
        const newClasses: string[] = [];
        const newHrefs: string[] = [];

        // Update ids
        for (let i = 0; i < ids.length; i += 1) {
          const id = ids[i];
          if (knownIds.has(id) === false) {
            newIds.push(id);
            knownIds.add(id);
          }
        }

        for (let i = 0; i < classes.length; i += 1) {
          const cls = classes[i];
          if (knownClasses.has(cls) === false) {

@cliqz/adblocker-content

Ghostery adblocker library (content-scripts helpers)

MPL-2.0
Latest version published 23 days ago

Package Health Score

56 / 100
Full package analysis

Similar packages