Skip to content

Commit

Permalink
Add rule for opera.com
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov committed Dec 19, 2023
1 parent 2cf6336 commit da4853b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/eval-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const snippets = {
EVAL_MICROSOFT_2: () => !!document.cookie.match('MSCC'),
EVAL_MOOVE_0: () => document.querySelectorAll('#moove_gdpr_cookie_modal input').forEach(i => { if (!i.disabled && i.name !== 'moove_gdpr_strict_cookies') i.checked = false }) || true,
EVAL_ONENINETWO_0: () => document.cookie.includes('CC_ADVERTISING=NO') && document.cookie.includes('CC_ANALYTICS=NO'),
EVAL_OPERA_0: () => document.cookie.includes('cookie_consent_essential=true') && !document.cookie.includes('cookie_consent_marketing=true'),
EVAL_PAYPAL_0: () => document.cookie.includes('cookie_prefs') === true,
EVAL_PRIMEBOX_0: () => !document.cookie.includes('cb-enabled=accepted'),
EVAL_PUBTECH_0: () => document.cookie.includes('euconsent-v2') && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)) ,
Expand Down
1 change: 1 addition & 0 deletions lib/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export type ClickRule = {
export type WaitForThenClickRule = {
waitForThenClick: ElementSelector;
timeout?: number;
all?: boolean;
};

export type WaitRule = {
Expand Down
34 changes: 34 additions & 0 deletions rules/autoconsent/opera.com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "opera.com",
"vendorUrl": "https://unknown",
"cosmetic": false,
"runContext": {
"main": true,
"frame": false
},
"intermediate": false,
"prehideSelectors": [],
"detectCmp": [
{
"exists": "#cookie-consent .manage-cookies__btn"
}
],
"detectPopup": [
{
"visible": "#cookie-consent .cookie-basic-consent__btn"
}
],
"optIn": [
{
"waitForThenClick": "#cookie-consent .cookie-basic-consent__btn"
}
],
"optOut": [
{ "waitForThenClick": "#cookie-consent .manage-cookies__btn" },
{ "waitForThenClick": "#cookie-consent .active.marketing_option_switch.cookie-consent__switch", "all": true },
{ "waitForThenClick": "#cookie-consent .cookie-selection__btn" }
],
"test": [
{ "eval": "EVAL_OPERA_0" }
]
}
5 changes: 5 additions & 0 deletions tests/opera.com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('opera.com', [
'https://www.opera.com'
]);

0 comments on commit da4853b

Please sign in to comment.