Difference between revisions of "Talk:Generalization of Joga extension"

From CDOT Wiki
Jump to: navigation, search
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
You should consider adding a screenshot of your extension so people can see it without having to install it first. ([[User:David.humphrey|David.humphrey]] 16:03, 21 November 2006 (EST))
 
You should consider adding a screenshot of your extension so people can see it without having to install it first. ([[User:David.humphrey|David.humphrey]] 16:03, 21 November 2006 (EST))
 +
 +
Hey paul, this is how you create a new tab into Firefox:
 +
 +
<pre>
 +
function openInNewTab (webpage)
 +
    if(webpage != '')
 +
    {
 +
var newTab = gBrowser.addTab(webpage);
 +
        gBrowser.selectedTab = newTab;
 +
    }
 +
}
 +
</pre>
 +
 +
Let me know if this works. --[[User:Pcvitori|Pcvitori]] 11:52, 29 November 2006 (EST)
 +
 +
Sorry i forgot to show you how to get the gBrowser variable. The following is the modified code.
 +
 +
<pre>
 +
function openInNewTab (webpage)
 +
    if(webpage != '')
 +
    {
 +
        var gBrowser = window.opener.getBrowser();
 +
var newTab = gBrowser.addTab(webpage);
 +
        gBrowser.selectedTab = newTab;
 +
    }
 +
}
 +
</pre>
 +
--[[User:Pcvitori|Pcvitori]] 11:53, 1 December 2006 (EST)
 +
 +
<pre>
 +
var gBrowser = window.parent.gBrowser;
 +
</pre>
 +
 +
Try that.. :)
 +
 +
--[[User:Pcvitori|Pcvitori]] 10:08, 2 December 2006 (EST)

Latest revision as of 10:08, 2 December 2006

You should consider adding a screenshot of your extension so people can see it without having to install it first. (David.humphrey 16:03, 21 November 2006 (EST))

Hey paul, this is how you create a new tab into Firefox:

function openInNewTab (webpage)
    if(webpage != '')
    {
	var newTab = gBrowser.addTab(webpage); 
        gBrowser.selectedTab = newTab; 
    }
}

Let me know if this works. --Pcvitori 11:52, 29 November 2006 (EST)

Sorry i forgot to show you how to get the gBrowser variable. The following is the modified code.

function openInNewTab (webpage)
    if(webpage != '')
    {
        var gBrowser = window.opener.getBrowser();
	var newTab = gBrowser.addTab(webpage); 
        gBrowser.selectedTab = newTab; 
    }
}

--Pcvitori 11:53, 1 December 2006 (EST)

var gBrowser = window.parent.gBrowser; 

Try that.. :)

--Pcvitori 10:08, 2 December 2006 (EST)