Top Tab View as default Reddit view when opening subreddits

I have no idea what I'm doing and I can't really help OP because he's using chrome, but if you're using Firefox and Greasemonkey you can make the following script for multireddits only:

` // ==UserScript== // @name Reddit Top Default // @namespace https://www.reddit.com/ // @description Changes default sorting of "Hot" to "Top" // @include https://www.reddit.com/* // @version 0.1 // @grant none // ==/UserScript==

var links,thisLink; links = document.evaluate("//a[@href]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i=0;i<links.snapshotLength;i++) { var thisLink = links.snapshotItem(i);

thisLink.href = thisLink.href.replace('https://www.reddit.com/me/m/video',
                                      'https://www.reddit.com/me/m/video/top');

thisLink.href = thisLink.href.replace('https://www.reddit.com/me/m/cars',
                                      'https://www.reddit.com/me/m/cars/top');

} `

What this does for me, is that I have two multireddits (Videos and Cars). When I click either of them on the reddit side panel, the default link is replaced with the link which goes straight to top, which means they will default to the top sorting every time.

The reason why you can't do it on "Front" or any other subreddit really, is because if you replace every instance of "reddit.com" with "reddit.com/top", it will screw up all links on the site. Every time you see a normal link on reddit (e.g., reddit.com/r/worldnews) the script will replace the link with reddit.com/top/r/worldnews" which doesn't make sense and will 404.

I assume XPathResult can only be used with Firefox, so a Chrome equivalent needs to be used.

Once again, I have no idea what I'm doing, but this is better than nothing for me.

/r/help Thread