// ==UserScript== // @name kbin subscriptions button // @namespace http://tampermonkey.net/ // @version 0.1 // @description adds a header button to kbin to instantly go to your subscriptions list // @author raltsm4k // @match https://kbin.social/* // @match https://fedia.io/* // @match https://karab.in/* // @icon https://www.google.com/s2/favicons?sz=64&domain=kbin.social // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; var a_login = document.querySelector("#header a.login"); var a_login_href = a_login.getAttribute("href"); if (a_login_href !== "/login") { var subs_button = document.createElement("li"); var a = document.createElement("a"); var i = document.createElement("i"); a.setAttribute("href", a_login_href + "/subscriptions"); a.setAttribute("aria-label", "View subscriptions"); a.setAttribute("title", "View subscriptions"); a.className = "icon"; i.className = "fa-solid fa-newspaper"; a.appendChild(i); subs_button.appendChild(a); var menu = document.querySelectorAll("#header menu")[1]; var search_button = menu.querySelector("li"); menu.insertBefore(subs_button, search_button); } })();