Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Joyreactor tag editor
- // @version 1
- // @grant none
- // @include https://reactor.cc/*
- // @include http://reactor.cc/*
- // @include https://*reactor.cc/*
- // @include http://*reactor.cc/*
- // ==/UserScript==
- var tags;
- var timeout = 500;
- setInterval(go, timeout);
- function go()
- {
- tags = document.getElementsByClassName("taglist");
- if (tags.length == 0)
- {
- var newtags;
- newtags = document.getElementsByClassName("post-tags");
- if (newtags.length > 0)
- {
- tags = Array();
- for (var i=0; i<newtags.length; i++)
- {
- tags.push(newtags[i].children[0])
- }
- }
- }
- if (tags.length > 0)
- {
- startChange()
- }
- }
- function startChange()
- {
- for (var i=0; i<tags.length; i++)
- {
- var thisTag = tags[i].children;
- for (var u=0; u<thisTag.length; u++)
- {
- ChangeLink(thisTag[u]);
- ChangeLink(thisTag[u].children[0]);
- }
- }
- }
- function ChangeLink(link)
- {
- if (link != undefined && link.getAttribute("href") != undefined)
- {
- var urlstring = link.getAttribute("href");
- if (!urlstring.endsWith("/all") && !urlstring.endsWith("rating"))
- {
- if (!urlstring.endsWith("/"))
- {
- urlstring = urlstring+"/all";
- }
- else
- {
- urlstring = urlstring+"all";
- }
- link.setAttribute("href", urlstring);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement