Skip to content

Instantly share code, notes, and snippets.

@atnbueno
Forked from mathix420/medium.user.js
Last active April 9, 2026 07:54
Show Gist options
  • Select an option

  • Save atnbueno/169a521dcb335639619da4e93c3939ee to your computer and use it in GitHub Desktop.

Select an option

Save atnbueno/169a521dcb335639619da4e93c3939ee to your computer and use it in GitHub Desktop.
Bypass Medium Paywall - Working April 2026 - Tested with Firefox+Violentmonkey, Vivaldi+Tampermonkey, and with Safari+Userscripts - Click "Raw" to install
// ==UserScript==
// @name Medium Paywall Bypass
// @namespace Violentmonkey Scripts
// @run-at document-end
// @match *://*.medium.com/*
// @match *://medium.com/*
// @grant none
// @version 3.1
// @icon https://miro.medium.com/v2/resize:fill:152:152/10fd5c419ac61637245384e7099e131627900034828f4f386bdaa47a74eae156
// @updateURL https://gist.githubusercontent.com/atnbueno/169a521dcb335639619da4e93c3939ee/raw/medium.user.js
// @downloadURL https://gist.githubusercontent.com/atnbueno/169a521dcb335639619da4e93c3939ee/raw/medium.user.js
// @website https://gist.githubusercontent.com/atnbueno/169a521dcb335639619da4e93c3939ee
// @author Mathix420, ZhymabekRoman, atnbueno
// ==/UserScript==
function mediumRedirecter() {
// Extract 12-char post ID from URL
const idMatch = location.pathname.match(/-([a-f0-9]{12})$/);
const id = idMatch && idMatch[1];
const isLocked = id && __APOLLO_STATE__?.[`Post:${id}`]?.isLocked;
// Only redirect locked Medium articles that aren't already on Freedium
if (
!location.hostname.includes('freedium') &&
!location.href.includes("/edit?source=") &&
document.head?.querySelector('meta[property="al:android:url"]')?.content?.includes('medium://p/') &&
isLocked
) {
location.href = 'https://freedium-mirror.cfd/' + location.href;
}
}
// Run redirect check immediately
mediumRedirecter();
// Set up a MutationObserver to handle SPA navigation / title changes
const title = document.querySelector('title');
if (title) {
new MutationObserver(mediumRedirecter).observe(title, {
subtree: true,
characterData: true,
childList: true,
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment