Skip to content

Commit

Permalink
Optin hotfix (#31)
Browse files Browse the repository at this point in the history
* Fix on-demand opt-in

* Add an opt-in shortcut for trustarc

* Fix a bug in Moove rule
  • Loading branch information
muodov authored Oct 3, 2022
1 parent 9f51a29 commit e304b11
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/cmps/trustarc-frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ export default class TrustArcFrame extends AutoConsentCMPBase {
}

async optIn() {
if (click('.call')) {
return true;
}
await this.navigateToSettings();
click(".switch span:nth-child(2)", true);

Expand Down
3 changes: 3 additions & 0 deletions lib/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ export default class AutoConsent {
case 'initResp':
this.initialize(message.config, message.rules);
break;
case 'optIn':
await this.doOptIn();
break;
case 'optOut':
await this.doOptOut();
break;
Expand Down
2 changes: 1 addition & 1 deletion rules/autoconsent/moove.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"then": [
{ "click": "#moove_gdpr_cookie_info_bar .change-settings-button" },
{ "waitForVisible": "#moove_gdpr_cookie_modal" },
{ "eval": "document.querySelectorAll('#moove_gdpr_cookie_modal input').forEach(i => { if (!i.disabled) i.checked = false }) || true" },
{ "eval": "document.querySelectorAll('#moove_gdpr_cookie_modal input').forEach(i => { if (!i.disabled && i.name !== 'moove_gdpr_strict_cookies') i.checked = false }) || true" },
{ "click": ".moove-gdpr-modal-save-settings" }
],
"else": [
Expand Down
1 change: 1 addition & 0 deletions tests/moove.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ generateCMPTests('Moove', [
'https://impact.parkinson.org/',
'https://wamu.org/',
'https://www.phorest.com/',
'https://theposterclub.com/',
], {});

generateCMPTests('Moove', [
Expand Down

0 comments on commit e304b11

Please sign in to comment.