Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Curse-No-Twitch-Launcher
- // @namespace
- // @match https://www.curseforge.com/minecraft/*
- // @grant none
- // ==/UserScript==
- // script source: https://old.reddit.com/r/feedthebeast/comments/c5t2xv/curseforge_has_changed/es44856/
- // lazy but idc rn
- var btnInner = `<span class="button__text"><svg class="icon icon-margin" viewBox="0 0 20 20" width="18" height="18"><use xlink:href="/Content/2-0-7116-38081/Skins/CurseForge/images/twitch/Action/Download.svg#Action/Download"></use></svg> Download</span>`;
- var anchors = document.querySelectorAll('a.button');
- for(var i=0; i < anchors.length; i++){
- var btn = anchors[i]
- var link = btn.href;
- if (link.includes("?client=y")) {
- if (btn.parentNode.parentNode.children.length > 1) { //cleanup mod buttons
- btn.parentNode.parentNode.removeChild(btn.parentNode);
- }else{ //otherwise assume modpack and just restyle the button
- btn.href = link.replace(/\?client=y/, "?client=n");
- btn.className = "button button--hollow";
- btn.innerHTML = btnInner;
- }
- }
- }
Add Comment
Please, Sign In to add comment