// ==UserScript== // @name New Instance Button for Libreddit // @namespace happyviking // @version 1.23.0 // @grant none // @run-at document-end // @license MIT // @description Adds a button to Libreddit instances to redirect to a new instance // @icon https://gitlab.com/uploads/-/system/project/avatar/32545239/libreddit.png // @author HappyViking // <> // @match https://l.opnxng.com/* // @match https://libreddit.bus-hit.me/* // @match https://libreddit.domain.glass/* // @match https://libreddit.freedit.eu/* // @match https://libreddit.kavin.rocks/* // @match https://libreddit.lunar.icu/* // @match https://libreddit.oxymagnesium.com/* // @match https://libreddit.privacy.com.de/* // @match https://libreddit.privacydev.net/* // @match https://libreddit.pussthecat.org/* // @match https://libreddit.tux.pizza/* // @match https://lr.4201337.xyz/* // @match https://lr.aeong.one/* // @match https://lr.artemislena.eu/* // @match https://lr.vern.cc/* // @match https://r.darklab.sh/* // @match https://reddit.baby/* // @match https://reddit.leptons.xyz/* // @match https://reddit.smnz.de/* // @match https://reddit.utsav2.dev/* // @match https://safereddit.com/* // @match https://snoo.habedieeh.re/* // <> // @downloadURL none // ==/UserScript== function main() { const navBar = document.querySelector('nav'); if (!navBar) return const firstDivInNavBar = navBar.querySelector("div") const newButton = document.createElement("button") firstDivInNavBar.prepend(newButton) newButton.appendChild(document.createTextNode("New Instance")) newButton.onclick = () => { console.log("hi") location.replace('https://farside.link/libreddit/' + window.location.pathname); } } main()