My firefox extension have to:
- Save an address of current page,
- Open new page
- Put this address into content of the new page, if a button will be pressed.
Problem is, how to save to var this address, becouse if I will do it from first function, the function that is from button doesnt have this var. Should i use a global function, or something?
function openTab() {
//Save an address of current page
path=content.location.href;
//Open new Tab and select it
var tab=gBrowser.addTab("chrome://intabeditor/content/editor.html");
var newTabBrowser = gBrowser.getBrowserForTab(tab);
gBrowser.selectedTab=tab;
}
function write() {
content.body.innerHTML=path;
}
Function openTab()
is execute, when proper button is pressed, the same with write()
function