TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Is there a browser extension for opening all links on HN in new tabs?

8 点作者 KoenDG将近 5 年前
By this I mean: add an option to the context menu of the browser that says &quot;open all links on this HN page&quot;.<p>And as a result of that, 25 tabs get opened, that being all the links on the page.<p>That&#x27;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&#x27;m just asking here on the off-chance that it exists but I somehow could not find it. If it doesn&#x27;t exist yet, I may well have to write it myself, which I frankly hope doesn&#x27;t take too much effort. Let&#x27;s hope there&#x27;s some decent boilerplate for this, that can be easily found.<p>Thanks in advance for any help.

9 条评论

neckardt将近 5 年前
I hacked together a quick bookmarklet, here&#x27;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 -&gt; Properties<p>3. Replace the &quot;Location&quot; field with:<p><pre><code> javascript:stories=document.getElementsByClassName(&quot;storylink&quot;);for(idx=0;idx&lt;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.
评论 #24173139 未加载
brudgers将近 5 年前
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.
gabrielsroka将近 5 年前
I took @neckardt&#x27;s bookmarklet and wrote a slightly shorter&#x2F;different version:<p><pre><code> javascript:document.querySelectorAll(&#x27;.storylink&#x27;).forEach(s=&gt;open(s.href)) &#x2F;&#x2F;Open All HN </code></pre> To install, select all the text (including the &quot;&#x2F;&#x2F;Open All HN&quot; 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&#x27;t do it...
scott31将近 5 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;clarete&#x2F;hackernews.el" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;clarete&#x2F;hackernews.el</a> This should do what you are asking
DonCopal将近 5 年前
There are also some alternative HN web clients and I believe some have Previous&#x2F;Next thread buttons, but I can&#x27;t remember now.
stevekemp将近 5 年前
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:&#x2F;&#x2F;gist.github.com&#x2F;toastal&#x2F;01c2387456ad2e6385f4" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;toastal&#x2F;01c2387456ad2e6385f4</a>
jituc将近 5 年前
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
thanatos519将近 5 年前
ISTR there was a gesture to do this in Galeon, but tabbed browsing has gone downhill since then.
KoenDG将近 5 年前
Sweet, thanks for the replies. I hadn&#x27;t considered simply using a bookmarklet, even.