Skip to content

Instantly share code, notes, and snippets.

@dangnhdev
Forked from altynbek132/free medium.js
Last active November 5, 2025 22:53
Show Gist options
  • Select an option

  • Save dangnhdev/86c3d1d08fdc5dc0d6288732748324ab to your computer and use it in GitHub Desktop.

Select an option

Save dangnhdev/86c3d1d08fdc5dc0d6288732748324ab to your computer and use it in GitHub Desktop.
custom site javascript
// ==UserScript==
// @name free medium
// @namespace http://tampermonkey.net/
// @version 2024-04-16
// @description try to take over the world!
// @author You
// @include *://medium.*.com/*
// @include *://*.medium.com/*
// @include *://medium.com/*
// @icon *://www.google.com/s2/favicons?sz=64&domain=medium.com
// @grant none
// ==/UserScript==
(function () {
"use strict";
// Your code here...
function getUrlPath(url) {
try {
const urlObj = new URL(url);
return urlObj.pathname; // This will return the path part of the URL
} catch (error) {
console.error("Invalid URL:", error);
return null;
}
}
const path = getUrlPath(window.location.href);
const newLoc = window.location
.toString()
.replace("https://", "https://freedium-mirror.cfd/");
window.open(newLoc, "_blank");
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment