NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Foreign Policy Paywall Remover // @namespace http://tampermonkey.net/ // @version 0.1 // @description Removes paywall from foreignpolicy.com // @author You // @match https://foreignpolicy.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=foreignpolicy.com // @grant none // @license MIT // ==/UserScript== const isElementLoaded = async selector => { while (document.querySelector(selector) === null) { await new Promise(resolve => requestAnimationFrame(resolve) ) } return document.querySelector(selector); }; (function() { 'use strict'; isElementLoaded('.in-article-subscribe-takeover-container').then((element) => { element.remove(); document.querySelector('.content-ungated').remove(); }); isElementLoaded('.content-gated--main-article').then((element) => { element.style.display = 'initial'; element.classList.remove('content-gated'); }); })();