From eb7e5f2b7fe3cea10cf8c02a0fe12ac9f6741848 Mon Sep 17 00:00:00 2001 From: Maxim Tsoy Date: Fri, 6 Dec 2024 20:39:28 +0100 Subject: [PATCH] Add a test page for CPM filterlist --- features/autoconsent/filterlist.html | 20 ++++++++++++++++++++ features/autoconsent/filterlist.js | 20 ++++++++++++++++++++ index.html | 1 + 3 files changed, 41 insertions(+) create mode 100644 features/autoconsent/filterlist.html create mode 100644 features/autoconsent/filterlist.js diff --git a/features/autoconsent/filterlist.html b/features/autoconsent/filterlist.html new file mode 100644 index 0000000..5b4e303 --- /dev/null +++ b/features/autoconsent/filterlist.html @@ -0,0 +1,20 @@ + + + + + + Cookie consent notice banner (Filterlist) + + + + +

[Home]

+ +

Tests for filterlist-based hiding of cookie banners.

+ +
+ This is a fake cookie banner that should be hidden by filterlist. +
+ + + diff --git a/features/autoconsent/filterlist.js b/features/autoconsent/filterlist.js new file mode 100644 index 0000000..0003c75 --- /dev/null +++ b/features/autoconsent/filterlist.js @@ -0,0 +1,20 @@ +const acceptButton = document.createElement('button'); +acceptButton.innerText = 'Accept all'; +acceptButton.id = 'accept-all'; +const banner = document.quesrySelector('#privacy-test-page-cmp-test-banner-filterlist'); +banner.appendChild(acceptButton); +acceptButton.addEventListener('click', (ev) => { + ev.target.innerText = 'Accept was clicked!'; + window.results.results.push('accept_button_clicked'); +}); + +setTimeout(() => { + if (window.getComputedStyle(banner).opacity === '0') { + window.results.results.push('banner_hidden'); + } +}, 500); + +window.results = { + page: 'autoconsent-filterlist', + results: [] +}; diff --git a/index.html b/index.html index b2ef027..9ddf67a 100644 --- a/index.html +++ b/index.html @@ -43,6 +43,7 @@

Browser Features

  • Fonts
  • Cookie consent popups
  • Cookie consent notice banners
  • +
  • Cookie consent notice banners (filterlist)
  • Navigator Interface
  • JS alerts and Hanging
  • Local storage