Created
April 15, 2021 16:15
-
-
Save dceddia/6e671406313bde9e7013038043ebf03f to your computer and use it in GitHub Desktop.
A Greasemonkey script to add Sequences and Rules as top-level nav items in ConvertKit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name CK - add page links to navbar | |
// @namespace Violentmonkey Scripts | |
// @match https://app.convertkit.com/* | |
// @grant none | |
// @version 1.0 | |
// @author - | |
// @description Adds Rules and Sequences to top-level nav | |
// ==/UserScript== | |
function modifyPage() { | |
const nav = getNavbar(); | |
const sequencesLink = document.createElement('li'); | |
sequencesLink.className = 'navbar-nav__item'; | |
sequencesLink.innerHTML = '<a href="/sequences">Sequences</a>'; | |
const rulesLink = document.createElement('li'); | |
rulesLink.className = 'navbar-nav__item'; | |
rulesLink.innerHTML = '<a href="/rules">Rules</a>'; | |
nav.insertAdjacentElement('beforeend', sequencesLink); | |
nav.insertAdjacentElement('beforeend', rulesLink); | |
} | |
function getNavbar() { | |
return document.querySelector('.navbar--main'); | |
} | |
function waitUntilReady() { | |
if(getNavbar()) { | |
modifyPage(); | |
} else { | |
setTimeout(waitUntilReady, 500); | |
} | |
} | |
waitUntilReady(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use this, you'll need a browser extension to load it. I use Violentmonkey in Chrome.
Then open the extension's menu:
And click the
+
to create a new script:Then delete the text that comes by default, and copy/paste the code above in place of it, and save.
Refresh ConvertKit, and you should see the tabs up top.