在我的 Stackoverflow 文件夹中,我有stackoverflow.ico
2 个波纹管文件。将其导入 Chrome 时,它会在地址栏中显示图标,但是当我单击它时,Chrome 不会打开任何新标签。我究竟做错了什么?
清单.json
{
"name": "Stackoverflow",
"version": "1",
"browser_action":
{
"default_icon": "stackoverflow.ico"
},
"background":
{
"page": "index.html"
},
"permissions": ["tabs"],
"manifest_version": 2
}
索引.html
<html>
<head>
<script>
chrome.browserAction.onClicked.addListener(function(activeTab)
{
var newURL = "http://stackoverflow.com/";
chrome.tabs.create({ url: newURL });
});
</script>
</head>
</html>