如何从代码中的Chrome中的同一组中的新选项卡中打开链接?
Chrome提供了在同一组中新选项卡中打开链接的选项。
我想在Chrome的同一组的新选项卡中在我的网站中打开a
标签链接。如何从HTML代码完成?
Chrome gives the option to open links in new tab in same group.
I want to open an a
tag link in my website in a new tab in the same group in chrome. How can this be done from HTML code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果将目标属性设置为
_Blank
,它应该可以工作,该属性告诉浏览器在新的选项卡/窗口中打开链接,具体取决于浏览器的设置。我尝试从Chrome Tab组中的网站打开一个链接,然后默认情况下,新的打开选项卡在同一选项卡组中。
如果您这样做,请不要忘记将REL属性集添加到Noreferrer noopener中,以防止您链接到的页面可能发生恶意攻击。
这是freecodecamp.org的一个示例:
这是FreecodeCamp的教程的链接。
It should work if you set the target attribute to
_blank
, which tells the browser to open the link in a new tab/window, depending on the browser's settings.I tried to open a link from a website that was in a chrome tab group and the new open tab was then in the same tab group by default.
If you do that don't forget to add the rel attribute set to noreferrer noopener to prevent possible malicious attacks from the pages you link to.
Here is an example from freecodecamp.org:
Here is the link to that tutorial from freecodecamp.