Skip to content

Instantly share code, notes, and snippets.

@bre7
Created October 20, 2018 02:42
Show Gist options
  • Save bre7/d2476c28feb582a5af5343ec62e978fc to your computer and use it in GitHub Desktop.
Save bre7/d2476c28feb582a5af5343ec62e978fc to your computer and use it in GitHub Desktop.
Add Twitter List icon to tabbar (next to Profile icon)
// ==UserScript==
// @name Lists in tabbar
// @version 1.0
// @description Show Lists icon next to the user avatar
// @author You
// @match https://twitter.com/*
// @grant none
// ==/UserScript==
function ready(fn) {
if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
ready( function() {
const listsItem = document.querySelectorAll('#user-dropdown > div > ul > li:nth-child(4)')[0].cloneNode(true);
listsItem.style.textDecoration = 'none';
document.querySelectorAll('#user-dropdown')[0].insertAdjacentHTML('afterend', listsItem.outerHTML);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment