From 6ea970e7a6914cdb2c5ffc8864a3a693c4485010 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sun, 31 Oct 2021 23:11:12 +0530 Subject: [PATCH] fix js userscript --- libmedium.user.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libmedium.user.js b/libmedium.user.js index 61903e3..fa6d586 100644 --- a/libmedium.user.js +++ b/libmedium.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name LibMedium proxy -// @version 0.1.1 +// @version 0.1.0 // @description Re-writes medium.com URLs in point to libmedium // @author Aravinth Manivannan // @match https://*/* @@ -20,13 +20,14 @@ const libmediumHost = "https://libmedium.batsense.net"; // morty has a button to go to the original site, re-writing that would be stupid if (!window.location.href.includes(libmediumHost)) { let urls = document.links; - + let lib = new URL(libmediumHost); for (let i = 0; i < urls.length; i++) { blacklist.forEach((url) => { if (urls[i].host.includes(url)) { - urls[i].host = libmediumHost; + urls[i].host = lib.host; } }); } } })(); +