Answer the question
In order to leave comments, you need to log in
How to create a new popup window in FireFox Extensions?
How to create a new popo FireFox Extensions window via ContextMenu, with Url like google.ru ?
In chrome, this is done in one or two
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
});
Answer the question
In order to leave comments, you need to log in
overlay chrome://browser/content/browser.xul chrome://vkwall/content/browser.xul
browser.xul
<?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);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question