ublock reddit promoted posts

// ==UserScript==
// @name         Washington Post Paywall Bypass
// @namespace    https://greasyfork.org/users/673609
// @version      0.9.9.2
// @description  Bypass Washington Post paywall.
// @match        https://www.washingtonpost.com/*
// @grant        none
// @run-at       document-start
// @license      magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
// ==/UserScript==



(function () {
  'use strict';
  
  window.addEventListener ('beforescriptexecute', function (e) {
    if (e.target.src.match (/pwapi-proxy.min.js/) || e.target.src.match (/wp-ad.min.js/)) {
      e.preventDefault ();
      e.stopPropagation ();
    }
  }, true);

  let s = document.createElement ("style");
  s.innerHTML = `
  [aria-label="Sections Navigation"] > div:nth-of-type(1),
  [aria-label="Sections Navigation"] > div:nth-of-type(2),
  .content_gate,
  [data-chain-name="subscription-promo-chain"],
  [data-qa="article-body-ad"],
  [data-qa="subscribe-promo"],
  [data-qa="subs-offer"],
  .ent-ad-container,
  .gift-offer,
  #leaderboard-wrapper,
  #nav-gift,
  #nav-subscribe,
  .paywall-overlay,
  #subscribe-left-nav,
  wp-ad {
    display: none !important;
  }`;
 
  document.addEventListener('DOMContentLoaded', (event)=> {
    document.body.appendChild (s);

    document.querySelectorAll ('img.unprocessed[data-hi-res-src]').forEach(el=> {
      el.src = el.attributes['data-hi-res-src'].value;
    });
  });

}) ();

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source