The new feature that was recently added to HN, which is to be able to toggle the collapse of the comment threads, has the toggle switch at the end of the comment header.<p>The script below puts it at the beginning of the comment header, just after the up/down vote arrows.<p>This has been tested in Firefox.<p><pre><code> // ==UserScript==
// @name HN: Change location of comment-collapse toggle switch
// @namespace HN_sendos
// @include https://news.ycombinator.com/item?id=*
// @version 1
// @run-at document-idle
// @grant none
// ==/UserScript==
(function()
{
var allPosts = document.getElementsByClassName('comhead');
for (var i = 0; i < allPosts.length; i++)
{
allPosts[i].innerHTML = allPosts[i].innerHTML.replace(RegExp("^(.+)(<a class=\"togg\" .+</a>)(.*)$","mg"), "$2 $1 $3");
}
})();</code></pre>