[Project_owners] Rewriting a browser inside a XUL app

Justin Wood Callek at juno.com
Mon May 17 02:01:20 EDT 2004


Sudhakar Chandra wrote:

> Hi,
>
> I have a browser inside my XUL application like so:
>
> <browser id="parsed-rss-feed" 
> src="chrome://habarixenu/locale/about.html" flex="1" onload="return 
> true;"/>
>
>
> As you can see, the browser loads a default about.html page when the 
> application loads.  I want to overwrite the contents of this browser 
> with HTML I create on the fly.  Currently, I am doing it like so:
>
>     var parsedContent = "<body>....</body>\n";
>
>     var parsedDocument = window.frames[0].document;
>     parsedDocument.body.innerHTML = parsedContent;
>
> I do not like this because:
>
> (a) History doesn't work. User clicks on a link in the browser element 
> in the application and the document pointed to by the link is loaded 
> onto the browser just fine.  When user now clicks the Back button they 
> see about.html and not my written content (parsedContent).
>
> (b) I want some scripts to go into the HEAD tag.
>
> How can I rewrite the XUL application's browser element's entire 
> contents?
>
> Thanks.
>
> Thaths

not sure if its a help, though try "about:blank" instead as your default.

~Justin Wood



More information about the Project_owners mailing list