Skip to content

Instantly share code, notes, and snippets.

@dceddia
Created September 29, 2021 13:55
Show Gist options
  • Save dceddia/ae13eb1008a882ed4735ae8992937936 to your computer and use it in GitHub Desktop.
Save dceddia/ae13eb1008a882ed4735ae8992937936 to your computer and use it in GitHub Desktop.
ConvertKit - revert back to the old nav bar.
// ==UserScript==
// @name CK - switch to the old nav
// @namespace Violentmonkey Scripts
// @match https://app.convertkit.com/*
// @grant none
// @version 1.0
// @author -
// @description Changes ConvertKit nav bar back to the old style, where each page has a link
// ==/UserScript==
function link(text, href) {
const el = document.createElement('a');
el.href = href;
el.innerText = text;
el.className = "hover:text-white";
return el;
}
function modifyPage() {
const nav = getNavbar();
nav.classList.remove('gap-6');
nav.classList.add('gap-12');
nav.replaceChildren(
link("Subscribers", "/subscribers"),
link("Forms", "/forms"),
link("Broadcasts", "/broadcasts"),
link("Sequences", "/sequences"),
link("Automations", "/automations"),
link("Rules", "/rules"),
);
}
function getNavbar() {
return document.querySelector('nav');
}
function waitUntilReady() {
if(getNavbar()) {
modifyPage();
} else {
setTimeout(waitUntilReady, 100);
}
}
waitUntilReady();
@dceddia
Copy link
Author

dceddia commented Sep 29, 2021

Install this using an extension like Violentmonkey.

Feel free to modify the list of links to whatever you like!

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