UNPKG

@cliqz/autoconsent

Version:

This is a library of rules for navigating through common consent popups on the web. These rules can be run in a Firefox webextension, or in a puppeteer orchestrated headless browser. Using these rules, opt-in and opt-out options can be selected automatica

12 lines (10 loc) 218 B
module.exports = async function checkRules(rules, page) { const matches = []; for (let rule of rules) { const elem = await page.$(rule); if (elem) { matches.push(rule); } } return matches; }