Last active
January 27, 2019 06:34
-
-
Save jbruggem/b5bf3b7242ee1484a6c8f9ef1ef62960 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name WaPo accept GDPR | |
// @version 1 | |
// @grant none | |
// @include https://www.washingtonpost.com/gdpr-consent/* | |
// @namespace https://symzo.be/gm | |
// ==/UserScript== | |
function waitForContinueButton(then){ | |
setTimeout(then(), 200); | |
} | |
function waitForAgreeButton(then){ | |
setTimeout(then(), 200); | |
} | |
function waitForConsentButton(then){ | |
setTimeout(then(), 200); | |
} | |
function clickContinueButton(){ | |
document.querySelector("button.continue-btn.button.free").click(); | |
} | |
function clickAgreeButton(){ | |
document.querySelector("#agree").click(); | |
} | |
function clickConsentButton(){ | |
document.querySelector(".continue-btn.button.accept-consent").click(); | |
} | |
function goThroughConsent(){ | |
waitForContinueButton(() => { clickContinueButton(); | |
waitForAgreeButton(() => { clickAgreeButton(); | |
waitForConsentButton(() => { clickConsentButton(); }); }); }); | |
} | |
window.addEventListener('load', goThroughConsent, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment