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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

The danger of target=_blank and opener

38 点作者 github-cat超过 6 年前

5 条评论

sam_goody超过 6 年前
Not the main point of the article, but he makes a comment that doesn&#x27;t sit well with me.<p>&gt; Also for SEO consideration, rel=&quot;nofollow&quot; is also recommended.<p>If you are linking to another site, that helps said site&#x27;s SEO ranking. If you use this in a way that the search engine views as cheating, the other site is penalized.<p>But as long as you and the other site are being fair, then you SHOULD link to them - they are obviously providing good content that you think is important, so why try to hog the credit and not give them the ranking they deserve.<p>Sitye like Stackoverflow do this to cut down on spam, (and perhaps because they want Google to view them as the original), but for a blog or whatever, why would you recommend this?
评论 #17995629 未加载
评论 #17995976 未加载
评论 #17995896 未加载
afraca超过 6 年前
Previous discussion: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12380671" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12380671</a><p>There were some high profile sites affected by this by the way, I think it was Instagram where it actually went wrong.
评论 #17995471 未加载
davidmurdoch超过 6 年前
There are performance implications to adding noopener, as outlined in in<a href="https:&#x2F;&#x2F;jakearchibald.com&#x2F;2016&#x2F;performance-benefits-of-rel-noopener&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jakearchibald.com&#x2F;2016&#x2F;performance-benefits-of-rel-n...</a><p>While the above link suggests noopener is beneficial to add as it will prevent the parent JS process from being paused by long running scripts in the child process, it <i>may</i> actually slow down the site being <i>opened</i> because of the additional time required to initialize the new child&#x27;s process.<p>It also prevents sites that want to auto-close their opened tab&#x2F;popup, like Facebook and other sharing sites, from being able to call `window.close` after sharing is complete.
评论 #17996590 未加载
daveFNbuck超过 6 年前
Is there a need for the default behavior? It feels like browsers should just switch this to the default for all external links with target=_blank.
gcb0超过 6 年前
add base tag with rel=noopener to everything you do today and be protected when browsers actually implement support for it.
评论 #17995942 未加载