Skip to content

Instantly share code, notes, and snippets.

@dceddia
Created April 15, 2021 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dceddia/6e671406313bde9e7013038043ebf03f to your computer and use it in GitHub Desktop.
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
// ==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();
@dceddia
Copy link
Author

dceddia commented Apr 15, 2021

To use this, you'll need a browser extension to load it. I use Violentmonkey in Chrome.

Then open the extension's menu:

image

And click the + to create a new script:

image

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.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment