[Project_owners] sizing a xul window to content in a browser element?

Preet Shihn preetshihn at gmail.com
Mon Jun 11 15:42:45 PDT 2007


you can find the full size of the content in the window to be:
width = contentwindow.innerWidth + contentwindow.scrollMaxX
height = contentwindow.innerHeight + contentwindow.scrollMaxY

then you can resize your xul window to wdth/height.
If your browser flex is set to 1, the browser will adjust accordingly.

You might have to give some margin to the width and height to deal with any
window/browser borders

- Preet

On 6/10/07, Bill Orcutt <bill at lilyapp.org> wrote:
>
> Hi-
>
> I have a window that contains a browser element and an onload routine
> that would like to size the outer xul window to fit the content
> contained in the inner browser window. The browser element has an
> attribute of flex=1. Calling sizeToContent on the xul window
> collapses it to nothing. Also tried calling sizeToContent on the
> contentWindow of the browser, but that seems to have no effect.  Has
> anyone found a way to do this?
>
> thanks
>
> -Bill
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20070611/3207d0d9/attachment.html 


More information about the Project_owners mailing list