Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

New Windows in XULRunner

421 views
Skip to first unread message

Greg Marine

unread,
Jul 5, 2008, 5:07:45 PM7/5/08
to
I'm using a browser element to display some Web content. When I click
on a link that would open a new window in, say, Firefox, it does
nothing in XULRunner. Is there a way to listen for the new window
event and either open a new window or open the link in the same
browser element? I've been searching for this answer and can't seem to
find it.

Thank you and God Bless <><
Greg Marine

Boris Zbarsky

unread,
Jul 7, 2008, 12:41:32 PM7/7/08
to
Greg Marine wrote:
> I'm using a browser element to display some Web content. When I click
> on a link that would open a new window in, say, Firefox, it does
> nothing in XULRunner. Is there a way to listen for the new window
> event and either open a new window or open the link in the same
> browser element?

I would have thought this would just work, with the default window creator in
xpfe...

You can certainly hook up an nsIWindowProvider, I would think.

-Boris

Greg Marine

unread,
Jul 8, 2008, 6:43:58 AM7/8/08
to
I've messaged around with prefs. for this, but I keep getting the
following warning when clicking links which would open in a new
window:

No chrome package registered for chrome://navigator/content/navigator.xul

Anyone know what I should do? Am I asking the wrong group?

Thank you and God Bless <><
Greg Marine

Neil

unread,
Jul 8, 2008, 8:06:45 AM7/8/08
to
Greg Marine wrote:

>I've messaged around with prefs. for this, but I keep getting the following warning when clicking links which would open in a new window:
>
>No chrome package registered for chrome://navigator/content/navigator.xul
>
>Anyone know what I should do?
>

You have two options:

1. You can change the browser.defaultChromeURL pref. This should
point to a XUL window with a <browser type="content-primary">
element in which the new page can be opened.
2. You can create an nsIBrowserDOMWindow object. This fields all
window opening calls, and allows you full control over what to do
with them (load in the existing window or a new tab perhaps).

--
Warning: May contain traces of nuts.

Mark Finkle

unread,
Jul 8, 2008, 3:13:01 PM7/8/08
to
On Jul 5, 5:07 pm, Greg Marine <gregmar...@gmail.com> wrote:
> I'm using a browser element to display some Web content. When I click
> on a link that would open a new window in, say, Firefox, it does
> nothing in XULRunner. Is there a way to listen for the new window
> event and either open a new window or open the link in the same
> browser element? I've been searching for this answer and can't seem to
> find it.


you can use a preference to tell XULRunner the XUL window to use when
opening webcontent windows:

pref("browser.chromeURL", "chrome://path/to/window.xul");

Prism does the same thing.

Greg Marine

unread,
Jul 9, 2008, 7:06:12 PM7/9/08
to
Thank you!!! This did the trick!

God Bless <><
Greg Marine

0 new messages