Opening mozbabel application in a tab instead of a window

One of my friend had asked whether the mozbabel example application (my talk at FOSS.IN) can be opened in a new tab instead of a window.

Yes, its really easy, all we have to do is to change the ShowMozbabel() function. The following diff when applied to chrome/chromeFiles/content/translate.js would open the mozbabel application in a new tab instead of a window:



3c3,9
<        window.open("chrome://mozbabel/content/mozbabelApp.xul");
---
>       
var aUrl = “chrome://mozflickr/content/mozbabelApp.xul”;
>
>       if (gBrowser)
{
>               var mozflickrTab = gBrowser.addTab(aUrl);
>               gBrowser.selectedTab = mozflickrTab;
>       } else
>               window.open(aUrl);

The gBrowser is the global browser object.

technorati tags: , , ,

Leave a Reply