// ==UserScript== // @name Bypass Washington Post Paywall // @description Bypasses Washington Post paywall with an XHR // @match https://www.washingtonpost.com/* // @require https://cdnjs.cloudflare.com/ajax/libs/axios/0.27.2/axios.min.js // ==/UserScript== // If element with grid-body class is present, assume this is an article const isArticle = !!document.querySelector('.grid-body'); // Look for the paywall modal //const hasPaywall = !!document.querySelector('#paywall-ui-responsive-modal'); // If this is not an article or it has no paywall, return now if (!isArticle) return; // Inject CSS to hide the paywall modal async function hidePaywallModal() { // Create the modal hider stylesheet var hidePaywallStyle = document.createElement('style'); hidePaywallStyle.innerHTML = ` [data-qa="overlay-container"] { display: none !important; } body { position: initial !important; height: initial !important; }`; // Append the paywall modal hider to the document head document.head.appendChild(hidePaywallStyle); } // Fetches the article via an XHR async function requestArticle(articleUrl) { const articleBody = document.querySelector('.grid-body'); // Display loading message so that users with slow connections don't think the script has failed articleBody.innerHTML = '