Last active
November 10, 2019 05:32
-
-
Save BubuInc/121dbeab10661f6a9780 to your computer and use it in GitHub Desktop.
Shouts from home redirect to their original shout
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 Shouts de la home a su shout original | |
// @namespace mangareader | |
// @description Ya no carga todo el mi | |
// @author http://www.taringa.net/MangaReader | |
// @include http://www.taringa.net/ | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var wrongLinks = document.querySelectorAll('.shouts a[href^="/mi/"]'); | |
var user; | |
for (var i = 0; i < wrongLinks.length; i++) { | |
var wrongLink = wrongLinks[i]; | |
if (wrongLink.parentNode.nodeName=="LI") { | |
user = wrongLink.parentNode.querySelector('a').getAttribute('href'); | |
wrongLink.href = user + "/mi/"+ wrongLink.getAttribute('href').match(/#(.+)/)[1]; | |
}else if(wrongLink.parentNode.parentNode.nodeName=="LI"){ | |
user = wrongLink.parentNode.parentNode.querySelector('a').getAttribute('href'); | |
wrongLink.href = user + "/mi/"+ wrongLink.getAttribute('href').match(/#(.+)/)[1]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment