TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Greasemonkey script to put the comment-collapse switch at the beginning

3 pointsby sendosalmost 9 years ago
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&#x2F;down vote arrows.<p>This has been tested in Firefox.<p><pre><code> &#x2F;&#x2F; ==UserScript== &#x2F;&#x2F; @name HN: Change location of comment-collapse toggle switch &#x2F;&#x2F; @namespace HN_sendos &#x2F;&#x2F; @include https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=* &#x2F;&#x2F; @version 1 &#x2F;&#x2F; @run-at document-idle &#x2F;&#x2F; @grant none &#x2F;&#x2F; ==&#x2F;UserScript== (function() { var allPosts = document.getElementsByClassName(&#x27;comhead&#x27;); for (var i = 0; i &lt; allPosts.length; i++) { allPosts[i].innerHTML = allPosts[i].innerHTML.replace(RegExp(&quot;^(.+)(&lt;a class=\&quot;togg\&quot; .+&lt;&#x2F;a&gt;)(.*)$&quot;,&quot;mg&quot;), &quot;$2 $1 $3&quot;); } })();</code></pre>

no comments

no comments