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