I am trying to build an application based on XulRunner. This
application will need to display some html pages so I want to use the
browser element (https://developer.mozilla.org/en/XUL/browser)
However it does not seem to work. Here is my very simple code :
I'm running with Firefox 13 on Mac OS X Snow Leopard. I have the same
result on Firefox 13 with WIndows XP (albeit no error message, just a
Note that if I replace the browser by an iframe, the page is correctly
On May 20, 4:52 pm, Neil <[hidden email]> wrote:
> GMouron wrote:
> > <browser src="http://www.mozilla.org" type="content-primary" />
> Does adding flex="1" to the browser make any difference?
> Warning: May contain traces of nuts.
I was able to get it working with some caveats. The only way I could
get the browser to display was in a straight dialog or window element
with no container. Placing the browser element in an iframe or vbox
would cause the src to not be displayed. Hope that's clear. For
example this code works:
This was tested using XULRunner 12.0 on Fedora 16.
On another note, I remember reading somewhere that it's better
security practice to call the local system's browser versus using the
browser element when displaying external sites. Is that still true?
Was it ever true?
dev-tech-xul mailing list
[hidden email] https://lists.mozilla.org/listinfo/dev-tech-xul
>So why is flex="1" needed in both elements?
The default size of a <browser>, <vbox> or <hbox> is 0x0. So you need to
do something to get them to take up space in the window. In your case of
a <browser> inside a <vbox>, you need to make the <vbox> take up space
in the window, which then gives you the chance to make the <browser>
take up space in the <vbox>.
Now for horizontal space you don't actually need to do anything as both
<window> and <vbox> will by default stretch their children to their own
width, so the <browser> is already the correct width. (You can if
necessary modify this using the align attribute.) However, you still
need to do something about the height of the browser. The flex="1" on
the browser will make it consume all the "spare" height of the <vbox>,
but that assumes that it has some to spare. To achieve this, you also
need to add flex="1" to the <vbox>, so that it will consume all the
spare height of the window.