【发布时间】:2016-11-05 15:42:55
【问题描述】:
我正在尝试制作一个 Chrome 扩展程序,单击扩展程序图标会打开一个新选项卡并重定向到一个 url。
我已经设法找到在每个新标签打开或加载 js 时重定向到 url 的答案,但我只希望它在单击扩展图标时执行。
这是损坏的代码:
manifest.json
{
"name": "Extension",
"description": "Opens a new tab and redirects",
"version": "0.2",
"chrome_url_overrides": {
"newtab": "redirect.html"
},
"manifest_version": 2
}
redirect.html
<head>
<meta http-equiv="refresh"content="0;URL=http://www.stackoverflow.com/">
</head>
有什么想法吗?提前致谢!
【问题讨论】:
标签: javascript html json google-chrome google-chrome-extension