var clickHandler = function(info, tab) {
chrome.windows.create({
"url" :"http://google.ru",
"width" : 600,
"height" : 540,
"type": "popup"
});
}
chrome.contextMenus.create({
"title": "Отправить на стенку",
"contexts": ["page", "selection", "image", "link"],
"onclick" : clickHandler
});
<?xml version="1.0"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="main.js" />
<menupopup id="contentAreaContextMenu" oncontextmenu="">
<menuitem id="saveToFile" label="Отправить на стенку" oncommand="newTabb();"/>
</menupopup>
</overlay>
function newTabb(){
var params = "menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=600,height=540";
var img = (content.getSelection().focusNode.firstElementChild.src != undefined) ? content.getSelection().focusNode.firstElementChild.src : "" ;
content.window.open("http://vk.com/share.php?image="+img+"&title="+content.document.title+"&url="+content.location.href+"&description="+content.getSelection().toString(), "Отпраить на стенку", params);
}