我目前正在尝试制作一个Google Chrome扩展程序,当您点击该图标时,该扩展会生成新的分隔符。目前,我只是在按下图标时使扩展程序打开一个新选项卡,如何更改此选项以便能够在任务栏中添加图像。
的manifest.json
{
"manifest_version": 2,
"name": "Moses - Part the Tab Sea",
"description": "This extension adds the ability to add separators to
tabs.",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html",
"default_title": "Add a Divider"
},
"background": {
"scripts": ["eventPage.js"],
"persistent": false
},
"permissions": [
"tabs"
]
}
Popup.js
document.onclick = addDivider();
function addDivider() {
chrome.tabs.create({index:(15)});
}