How to edit the Reddit navigation bar using Greasemonkey?

Viewed 399

I'm trying to make the Reddit navigation bar only display a few subreddits like this: http://i.imgur.com/eDOdUBJ.png

Using code from another userscript (https://greasyfork.org/en/scripts/12571-expand-subreddit-header), I was able to remove the text:

var css = document.createElement("style");
css.type = "text/css";
css.innerHTML = 
    "#sr-header-area .flat-list > li  { white-space: initial !important; } " + 
    "#sr-header-area .dropdown.srdrop { padding-left: 0 !important; }" +
    ".sr-list                         { display: inline !important; visibility: hidden; } " +
    "#sr-header-area > .width-clip    { position: initial !important; padding-left: 5px !important; } " +
    "#sr-more-link                    { display: none !important; } " +
    ".dropdown.srdrop                 { display: none !important; }";

document.head.appendChild(css);

However, I'm stuck trying to figure out how to replace it with text links. The code for the navigation bar with two links looks like this:

<div id="sr-header-area">
<div class="width-clip">
<div class="sr-list">
<span class="separator">&nbsp;</span>
<ul class="flat-list sr-bar hover" id="sr-bar">
<li><a href="https://www.reddit.com/r/AskReddit/" class="choice">AskReddit</a></li>
<li><span class="separator">-</span><a href="https://www.reddit.com/r/funny/" class="choice">funny</a></li>
</ul>
</div>
</div>
</div>

Any help would be appreciated. Thanks.

1 Answers
Related