15/08/14 02:25:46.31 XKIyVgKq0.net
●background.html
<html><head>
<script type="text/javascript" src="background.js"></script>
</head><body>
<input type="text" id="test_id" value="">
</body></html>
●background.js
function getClickHandler() {
return function(info, tab) {
document.getElementById("test_id").value=info.selectionText
window.open("test.html", "_blank")
};
};
var parentId = chrome.contextMenus.create({
"title" : "samplemenu",
"type" : "normal",
"contexts" : ["selection"],
"onclick" : getClickHandler()
});