fb_pixel

How to create a new popup window in Firefox Extensions?

Development | Web Development
Description
How to create a new popo window FireFox Extensions via ContextMenu, with a URL for example google.ru?
In chrome, this is done once or twice

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
  });

And how to do in FF, I can not figure it out.
Attachments
No attachments
Info
Description
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="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);	
}

on March 19th, 2020 (10:53 pm)
Description
Thanks
on March 20th, 2020 (2:22 pm)
All coments
This job has not been commented yet.


How to create a new popup window in Firefox extensions?

IT & Software | Other
Description
How to create a new popo window FireFox Extensions via ContextMenu, with a URL for example google.ru? In chrome, this is done once or twice:

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
  });
Attachments
No attachments
Info
Description
Overlay chrome://browser/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="Send to wall" oncommand="newTabb();"/>
    </menupopup>
</overlay>

main, js
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);	
}

on June 08th, 2020 (10:19 pm)
All coments
This job has not been commented yet.