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

81 lines (66 loc) 1.34 kB
export type AutoConsentCMPRule = { name: string prehideSelectors?: string[] isHidingRule?: boolean detectCmp: AutoConsentRuleStep[] detectPopup: AutoConsentRuleStep[] frame?: string optOut: AutoConsentRuleStep[] optIn: AutoConsentRuleStep[] openCmp?: AutoConsentRuleStep[] test?: AutoConsentRuleStep[] } export type AutoConsentRuleStep = { frame?: boolean; optional?: boolean } & Partial< ElementExistsRule > & Partial<ElementVisibleRule> & Partial<EvalRule> & Partial<WaitForRule> & Partial<ClickRule> & Partial<WaitForThenClickRule> & Partial<WaitRule> & Partial<UrlRule> & Partial<GotoUrlRule> & Partial<HideRule> & Partial<UndoHideRule> & Partial<WaitForFrameRule>; type ElementExistsRule = { exists: string; }; type ElementVisibleRule = { visible: string; check?: "any" | "all" | "none"; }; type EvalRule = { eval: string; }; type WaitForRule = { waitFor: string; timeout?: number; }; type ClickRule = { click: string; all?: boolean; }; type WaitForThenClickRule = { waitForThenClick: string; timeout?: number; }; type WaitRule = { wait: number; }; type UrlRule = { url: string; }; type GotoUrlRule = { goto: string; }; type HideRule = { hide: string[]; }; type UndoHideRule = { undoHide: boolean; } type WaitForFrameRule = { waitForFrame: true };