My Profile Link

Adds a link to profile in nav bar

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         My Profile Link
// @namespace    http://tampermonkey.net/
// @license      MIT
// @version      0.2.1
// @description  Adds a link to profile in nav bar
// @author       cass_per
// @match        https://spacehey.com/*
// @match        https://blog.spacehey.com/*
// @match        https://forum.spacehey.com/*
// @match        https://groups.spacehey.com/*
// @match        https://layouts.spacehey.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=spacehey.com
// @grant        none
// ==/UserScript==

var id = "YOUR ID HERE";
var user="YOUR USER HERE";
// can leave user blank if you have id as url (default option)

const navi = document.getElementsByTagName("nav")[0].getElementsByClassName("links")[0];

var link = document.createElement("li");
link.innerHTML = "<a href='https://spacehey.com/profile?id="+ id +"'>&nbsp;Me</a>";

navi.prepend(link);

var home = navi.getElementsByTagName("li")[1];
navi.prepend(home);

var cur = window.location.href;
if (cur == "https://spacehey.com/profile?id="+ id || cur == "https://spacehey.com/"+ user) {
    home.classList.remove("active");
    link.classList.add("active");
}