清单.json:
{
"background_page": "background.html",
"browser_action": {
"default_icon": "icon-128.png"
},
"name": "testtt",
"description": "testttttttt",
"icons": {
"16": "icon-16.png",
"48": "icon-48.png",
"128": "icon-128.png" },
"permissions": [
"tabs",
"http://*/*",
"https://*/*"
],
"version": "0.1"
}
背景.html:
<script>
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript(tab.id, {file: "bookmarklet.js"})
});
</script>
书签.js:
alert("hello");
当我安装这个扩展时,右上角的按钮不起作用。所以我需要重新启动 chrome 才能让它工作。为什么 ?