@duckduckgo/autoconsent 16.15.0 → 16.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2530,6 +2530,25 @@
2530
2530
  constructor() {
2531
2531
  super(...arguments);
2532
2532
  this.name = "Admiral";
2533
+ this.consentCardSelector = "div > div[class*=Card] > div[class*=Frame] > div[class*=Pills] > button[class*=Pills__StyledPill]";
2534
+ }
2535
+ getVrmNotice() {
2536
+ return Array.from(document.querySelectorAll("body > div")).find((element) => {
2537
+ const text = element.innerText || "";
2538
+ const rect = element.getBoundingClientRect();
2539
+ const style = getComputedStyle(element);
2540
+ return style.position === "fixed" && rect.width > 0 && rect.height > 0 && text.includes("Your Privacy") && text.includes("VRM") && text.includes("Admiral");
2541
+ });
2542
+ }
2543
+ isVisibleElement(element) {
2544
+ const rect = element.getBoundingClientRect();
2545
+ const style = getComputedStyle(element);
2546
+ return rect.width > 0 && rect.height > 0 && style.display !== "none" && style.visibility !== "hidden";
2547
+ }
2548
+ getVrmCloseButton() {
2549
+ const notice = this.getVrmNotice();
2550
+ const closeButton = notice?.querySelector('button[aria-label="Close"]');
2551
+ return closeButton && this.isVisibleElement(closeButton) ? closeButton : null;
2533
2552
  }
2534
2553
  get hasSelfTest() {
2535
2554
  return false;
@@ -2541,19 +2560,20 @@
2541
2560
  return false;
2542
2561
  }
2543
2562
  async detectCmp() {
2544
- return this.elementExists("div > div[class*=Card] > div[class*=Frame] > div[class*=Pills] > button[class*=Pills__StyledPill]");
2563
+ return await this.elementExists(this.consentCardSelector) || Boolean(this.getVrmNotice());
2545
2564
  }
2546
2565
  async detectPopup() {
2547
- return this.elementVisible(
2548
- "div > div[class*=Card] > div[class*=Frame] > div[class*=Pills] > button[class*=Pills__StyledPill]",
2549
- "any"
2550
- );
2566
+ return await this.elementVisible(this.consentCardSelector, "any") || Boolean(this.getVrmNotice());
2551
2567
  }
2552
2568
  async optOut() {
2553
2569
  const rejectAllSelector = "xpath///button[contains(., 'Afvis alle') or contains(., 'Reject all') or contains(., 'Odbaci sve') or contains(., 'Rechazar todo') or contains(., 'Atmesti visus') or contains(., 'Odm\xEDtnout v\u0161e') or contains(., '\u0391\u03C0\u03CC\u03C1\u03C1\u03B9\u03C8\u03B7 \u03CC\u03BB\u03C9\u03BD') or contains(., 'Rejeitar tudo') or contains(., 'T\xFCm\xFCn\xFC reddet') or contains(., '\u041E\u0442\u043A\u043B\u043E\u043D\u0438\u0442\u044C \u0432\u0441\u0435') or contains(., 'Noraid\u012Bt visu') or contains(., 'Avvisa alla') or contains(., 'Odrzu\u0107 wszystkie') or contains(., 'Alles afwijzen') or contains(., '\u041E\u0442\u0445\u0432\u044A\u0440\u043B\u044F\u043D\u0435 \u043D\u0430 \u0432\u0441\u0438\u0447\u043A\u0438') or contains(., 'Rifiuta tutto') or contains(., 'Zavrni vse') or contains(., 'Az \xF6sszes elutas\xEDt\xE1sa') or contains(., 'Respinge\u021Bi tot') or contains(., 'Alles ablehnen') or contains(., 'Tout rejeter') or contains(., 'Odmietnu\u0165 v\u0161etko') or contains(., 'L\xFCkka k\xF5ik tagasi') or contains(., 'Hylk\xE4\xE4 kaikki')]";
2554
2570
  if (await this.waitForElement(rejectAllSelector, 500)) {
2555
2571
  return await this.click(rejectAllSelector);
2556
2572
  }
2573
+ const vrmCloseButton = this.getVrmCloseButton();
2574
+ if (vrmCloseButton) {
2575
+ return await this.clickElement(vrmCloseButton);
2576
+ }
2557
2577
  const purposesButtonSelector = "xpath///button[contains(., 'Zwecke') or contains(., '\u03A3\u03BA\u03BF\u03C0\u03BF\u03AF') or contains(., 'Purposes') or contains(., '\u0426\u0435\u043B\u0438') or contains(., 'Eesm\xE4rgid') or contains(., 'Tikslai') or contains(., 'Svrhe') or contains(., 'Cele') or contains(., '\xDA\u010Dely') or contains(., 'Finalidades') or contains(., 'M\u0113r\u0137i') or contains(., 'Scopuri') or contains(., 'Fines') or contains(., '\xC4ndam\xE5l') or contains(., 'Finalit\xE9s') or contains(., 'Doeleinden') or contains(., 'Tarkoitukset') or contains(., 'Scopi') or contains(., 'Ama\xE7lar') or contains(., 'Nameni') or contains(., 'C\xE9lok') or contains(., 'Form\xE5l')]";
2558
2578
  const saveAndExitSelector = "xpath///button[contains(., 'Spara & avsluta') or contains(., 'Save & exit') or contains(., 'Ulo\u017Eit a ukon\u010Dit') or contains(., 'Enregistrer et quitter') or contains(., 'Speichern & Verlassen') or contains(., 'Tallenna ja poistu') or contains(., 'I\u0161saugoti ir i\u0161eiti') or contains(., 'Opslaan & afsluiten') or contains(., 'Guardar y salir') or contains(., 'Shrani in zapri') or contains(., 'Ulo\u017Ei\u0165 a ukon\u010Di\u0165') or contains(., 'Kaydet ve \xE7\u0131k\u0131\u015F yap') or contains(., '\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0438 \u0432\u044B\u0439\u0442\u0438') or contains(., 'Salvesta ja v\xE4lju') or contains(., 'Salva ed esci') or contains(., 'Gem & afslut') or contains(., '\u0391\u03C0\u03BF\u03B8\u03AE\u03BA\u03B5\u03C5\u03C3\u03B7 \u03BA\u03B1\u03B9 \u03AD\u03BE\u03BF\u03B4\u03BF\u03C2') or contains(., 'Saglab\u0101t un iziet') or contains(., 'Ment\xE9s \xE9s kil\xE9p\xE9s') or contains(., 'Guardar e sair') or contains(., 'Zapisz & zako\u0144cz') or contains(., 'Salvare \u0219i ie\u0219ire') or contains(., 'Spremi i iza\u0111i') or contains(., '\u0417\u0430\u043F\u0430\u0437\u0432\u0430\u043D\u0435 \u0438 \u0438\u0437\u0445\u043E\u0434')]";
2559
2579
  if (await this.waitForThenClick(purposesButtonSelector) && await this.waitForVisible(saveAndExitSelector)) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2026.7.23",
4
+ "version": "2026.7.25",
5
5
  "background": {
6
6
  "service_worker": "background.bundle.js"
7
7
  },