下記は、コンテクストメニューに「test」と表示させ、これがクリックされたら、「recieved」とアラートを出す例。
★manifest.json
...
"permissions": ["contextMenus"],
...
"permissions": ["contextMenus"],
...
★background_page
function fromContext() {
alert("received");
}
chrome.contextMenus.create({title: "test", onclick: fromContext});
alert("received");
}
chrome.contextMenus.create({title: "test", onclick: fromContext});
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.