如何使popup.html链接在标签中打开? [英] How to make popup.html links open in tab?

查看:110
本文介绍了如何使popup.html链接在标签中打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Chrome扩展,其中包含一些链接。目前点击链接时什么都不做,我想在点击时让它们在新标签中打开。这可能吗?



另一种方法是将链接打开javascript代码添加到链接上的mousedown事件。



您也可以使用 base 标记使所有链接以 target =_ blank打开:

 < head> 
< base target =_ blank>
< / head>


I have a Chrome extension that has some links in it. Currently when clicked the links do nothing, i would like to make them open in a new tab when clicked. Is this possible?

解决方案

Add target="_blank" to links.

Another way is to attach link opening javascript code to mousedown event on a link.

You can also use base tag to make all links open with target="_blank":

<head>
    <base target="_blank">
</head>

这篇关于如何使popup.html链接在标签中打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆