Washington Post Paywall Bypass

Bypass Washington Post paywall.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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;
    });
  });

}) ();