Skip to content

Commit

Permalink
Move autoconsent button creation to script. (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
sammacbeth authored Nov 26, 2021
1 parent 41f77f9 commit 96c34ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion features/autoconsent/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<p id="privacy-test-page-cmp-test">
This is a fake consent popup:
<button id="reject-all">This should be clicked automatically.</button>
</p>

<p>Real sites to test on:</p>
Expand Down
6 changes: 5 additions & 1 deletion features/autoconsent/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ Object.keys(testSites).forEach((cmpName) => {
});

// dummy CMP
document.getElementById('reject-all').addEventListener('click', (ev) => {
const button = document.createElement('button');
button.innerText = 'This should be clicked automatically.';
button.id = 'reject-all';
document.getElementById('privacy-test-page-cmp-test').appendChild(button);
button.addEventListener('click', (ev) => {
ev.target.innerText = 'I was clicked!';
window.results.results.push('button_clicked');
});
Expand Down

0 comments on commit 96c34ec

Please sign in to comment.