By this I mean: add an option to the context menu of the browser that says "open all links on this HN page".<p>And as a result of that, 25 tabs get opened, that being all the links on the page.<p>That's my use case: I want to open up all the links, at the same time, each in their own tab, and I can just CTRL+TAB through them as I please.<p>I'm just asking here on the off-chance that it exists but I somehow could not find it. If it doesn't exist yet, I may well have to write it myself, which I frankly hope doesn't take too much effort. Let's hope there's some decent boilerplate for this, that can be easily found.<p>Thanks in advance for any help.
I hacked together a quick bookmarklet, here's how to get it working in firefox:<p>1. Create a new bookmark to any page, name it whatever.<p>2. Right click the bookmark -> Properties<p>3. Replace the "Location" field with:<p><pre><code> javascript:stories=document.getElementsByClassName("storylink");for(idx=0;idx<stories.length;idx++){ window.open(stories[idx].href)}
</code></pre>
While on HN if you click the bookmarklet, it will open all of the links in a new tab.
I once wrote a greasemonkey script to do exactly that. The tricky bit was the rate limit of HN requests required adding an empirically determined delay inside the loop iterating through the links (there are thirty on the main page not 25).<p>Even with the delay one or two of the thirty requests would usually hit the rate limit, but this was faster than slowing the loop down with a larger delay in terms of how I used the script. It was kludge coded but good enough for my needs.<p>Note that “all the links” is not all the links. There are flag and vote and user account and site history and two discussion links for the typical front page story. Plus the header and footer links and the login or logged in links.
I took @neckardt's bookmarklet and wrote a slightly shorter/different version:<p><pre><code> javascript:document.querySelectorAll('.storylink').forEach(s=>open(s.href)) //Open All HN
</code></pre>
To install, select all the text (including the "//Open All HN" comment) and drag it to your bookmarks toolbar. The comment becomes the bookmark name in Chrome and it kinda works in Safari, but not in Firefox.<p>Is anyone worried about opening 30 random-ish links? I wouldn't do it...
<a href="https://github.com/clarete/hackernews.el" rel="nofollow">https://github.com/clarete/hackernews.el</a> This should do what you are asking
Not an extension, but this is a common thing that could be done with a bookmarklet - open all links on the current page in a new tab.<p>Perhaps this is a good starting point:<p><a href="https://gist.github.com/toastal/01c2387456ad2e6385f4" rel="nofollow">https://gist.github.com/toastal/01c2387456ad2e6385f4</a>
It would be easier to write greasemonkey script. I use it to read manga, just loop through title links and open with _blank target with time delay of 1s as setTimeOut delay