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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

News.YC: open links in new tab

9 点作者 modulow将近 15 年前
I know this is no great feat, but just wanted to post my bookmarklet, that I use to turn all the links on news.yc into `target="_blank"` links:<p>&#60;a href="javascript:function%20getScript(url,%20success)%20{var%20d%20=%20document,script%20=%20d.createElement(%27script%27),head%20=%20d.getElementsByTagName(%27head%27)[0],done%20=%20false;script.src%20=%20url;script.onload%20=%20script.onreadystatechange%20=%20function(){if(%20!done%20&#38;&#38;%20(!this.readyState%20||%20this.readyState%20==%20%27loaded%27%20||%20this.readyState%20==%20%27complete%27)%20)%20{done%20=%20true;success();script.onload%20=%20script.onreadystatechange%20=%20null;head.removeChild(script);}};head.appendChild(script);}getScript(%22http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js%22,%20function()%20{if(%20typeof%20jQuery%20==%20%27undefined%27%20)%20{alert(%22jQuery%20could%20not%20be%20loaded%22);}$(%22td.title%20a%22).attr(%22target%22,%20%22_blank%22);});"&#62;YC - Open in new Tab&#60;/a&#62;

3 条评论

mrduncan将近 15 年前
Alternatively, nearly all browsers support middle clicking on links to open them in a new window.
评论 #1621960 未加载
swedegeek将近 15 年前
On my netbook, I have a multi-touch trackpad, so a 2-finger tap does the trick as well. Even with the "target=_blank" I'd probably still do a middle-click/2-finger tap to have the new tab open in the background. That way, I can quickly scan HN (or reddit or whatever else) and open up all the items I'm interested in and then read through them rapid fire.<p>Good exercise, though!
ajbatac将近 15 年前
+1 for the effort.