Last active
July 31, 2019 21:23
-
-
Save RichardVasquez/942b2b98d537dfe5bae9b05ca490c370 to your computer and use it in GitHub Desktop.
Nuke medium links on lobste.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Nuke Medium on Lobste.rs | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Richard Vasquez | |
// @match https://lobste.rs/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var look_for = "u-url"; | |
var url_list = document.getElementsByClassName(look_for); | |
for(var i = 0; i < url_list.length; i++) { | |
if( | |
(!url_list[i].href.toLowerCase().startsWith("https://medium.com/") && | |
!url_list[i].href.toLowerCase().startsWith("https://www.medium.com/")) | |
){ | |
continue; | |
} | |
var li = url_list[i].parentElement.parentElement.parentElement.parentElement; | |
li.parentNode.removeChild(li); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment