var clickHandler=function(info, tab) {
chrome.windows.create({
"url":"http://google.com",
"width": 600,
"height": 540,
"type":"popup"
});
}
chrome.contextMenus.create({
"title":"Send to wall",
"contexts":["page","selection","image","link"],
"onclick": clickHandler
});
var clickHandler=function(info, tab) { chrome.windows.create({ "url":"http://google.com", "width": 600, "height": 540, "type":"popup" }); } chrome.contextMenus.create({ "title":"Send to wall", "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="Send to wall" oncommand="newTabb();"/>
</menupopup>
</overlay>
main, js 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(),"Send to wall", params); }
Description