Skip to content

Commit

Permalink
Add rules for Pubtech (CMP) (#25)
Browse files Browse the repository at this point in the history
* rules added WIP

* optout working - self test to wip

* need self test

* pubtech selftest added & localtest passed

* logs disabled

* selector found for leFonti, now to be merged with others

* rules, selftest, localtest working - waiting for feedbacks on the eval logic

* logs disabled

* Corrected microsoft mistake

* detectPopup reduced to 1 selector

* optIn now with conditional rule

* parenthesis added to eval logic

* L26 just some whitespace added

Co-authored-by: euw-arasolofotsara1 <arasolofotsara@duckduckgo.com>
  • Loading branch information
icodebyamanda and euw-arasolofotsara1 authored Sep 16, 2022
1 parent b29c9e7 commit fa83a98
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
42 changes: 42 additions & 0 deletions rules/autoconsent/pubtech.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "pubtech",
"prehideSelectors": ["#pubtech-cmp"],
"detectCmp": [
{
"exists": "#pubtech-cmp"
}
],
"detectPopup": [
{
"visible": "#pubtech-cmp #pt-actions"
}
],
"optIn": [
{
"if": {
"exists": "#pt-accept-all"
},
"then": [
{
"click": "#pubtech-cmp #pt-actions #pt-accept-all"
}
],
"else": [
{
"click": "#pubtech-cmp #pt-actions button:nth-of-type(2)"
}
]
}
],
"optOut": [

{
"click": "#pubtech-cmp #pt-close"
}
],
"test": [
{
"eval": "document.cookie.includes('euconsent-v2') && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)) "
}
]
}
13 changes: 13 additions & 0 deletions tests/pubtech.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('pubtech', [
'https://www.lefonti.tv/',
'https://www.liberoquotidiano.it/',
'https://www.telefonino.net/',
'https://www.fattoincasadabenedetta.it/',
'https://www.quotidianopiemontese.it/',
'https://www.iltelegrafolivorno.it/',
'https://www.agrigentooggi.it/',
'https://blog.cliomakeup.com/',
'https://www.leccenews24.it/'
]);

0 comments on commit fa83a98

Please sign in to comment.