Skip to content

Instantly share code, notes, and snippets.

@arpit
Created February 15, 2022 19:33
Show Gist options
  • Save arpit/9101122042d49c651f67f2f55c095147 to your computer and use it in GitHub Desktop.
Save arpit/9101122042d49c651f67f2f55c095147 to your computer and use it in GitHub Desktop.
A userscript for TamperMonkey that adds a home button to IndieHackers.com
// ==UserScript==
// @name Indiehackers home button
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add Home to IndieHackers.com
// @author Arpit Mathur
// @match https://www.indiehackers.com/*
// @icon https://www.google.com/s2/favicons?domain=indiehackers.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
setTimeout(function(){
var str = '<li class="nav-menu__item nav-menu__item--forum"><a href="/" class="nav-menu__link ember-view"><span class="nav-menu__label">Home</span></a> </li>'
var home = document.createRange().createContextualFragment(str);
document.querySelector("ul.nav-menu > li").after(home.firstChild);
}, 5000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment