Skip to content

Instantly share code, notes, and snippets.

@jbruggem
Last active January 27, 2019 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbruggem/b5bf3b7242ee1484a6c8f9ef1ef62960 to your computer and use it in GitHub Desktop.
Save jbruggem/b5bf3b7242ee1484a6c8f9ef1ef62960 to your computer and use it in GitHub Desktop.
// ==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