[Project_owners] Opening a new browser tab from a siebar application

Laeb laebcontact at hotmail.com
Mon Jul 5 18:09:52 EDT 2004


Try this function:
"openNewTabWith(url);"
Ons.

----- Original Message ----- 
From: "Scott McWhirter" <scott at xede.org>
To: <project_owners at mozdev.org>
Sent: Monday, July 05, 2004 4:53 PM
Subject: [Project_owners] Opening a new browser tab from a siebar
application


> hey all,
>
> Currently writing a little sidebar application but am having difficulty
> grokking the documentation in terms of this.
> I know i need to get a reference to the currently running browser
> window, which i've got, but there doesn't
> seem to be any sort of sane interface to load a uri in a new tab. Here's
> what i've got at the moment:
>
> --------------------------------------------------------------------------
--------------------------------------------------------------------------
> var windowmanager =
>
Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Com
ponents.interfaces.nsIWindowMediator);
>
> var browser = windowmanager.getMostRecentWindow('navigator:browser');
>
> // open link in new tab
> var url = 'http://kungfuftr.com/code/mozilla';
> var tab = browser.parent.newTab(url);
> --------------------------------------------------------------------------
---------------------------------------------------------------------------
> If anyone has any suggestions, I'd be extremely grateful.
> ta!
>
>
> -- 
> -Scott McWhirter- | -kungfuftr-
> XEDE Project Co-Ordinator
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
>


More information about the Project_owners mailing list