My Profile Link

Adds a link to profile in nav bar

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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");
}