[Project_owners] Rewriting a browser inside a XUL app

Sudhakar Chandra thaths at openscroll.org
Fri May 21 17:11:30 EDT 2004


Neil wrote:
> Sudhakar Chandra wrote:
>> How can I rewrite the XUL application's browser element's entire 
>> contents?
> parsedDocument.open/write/close?


I tried the following but it seg faults Mozilla 1.6 after repeatedly 
going into buildTreeFromDataSource()

habarixenu.xul (key elements)
--------------
<?xml version="1.0"?>
...
<!DOCTYPE window [
<!ENTITY % habarixenuDTD SYSTEM "chrome://habarixenu/locale/habarixenu.dtd">
%habarixenuDTD;
]>
...
<window id="habarixenu-window"
     windowtype="navigator:browser"
     contenttitlesettting="true"
     title="Habari Xenu"
     label="Habari Xenu"
     orient="horizontal"
     xmlns:html="http://www.w3.org/1999/xhtml"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     onload="buildTreeFromDataSource()"
     onunload="">
<script src="habarixenu.js"/>
<vbox flex="1">
     <toolbox>
	<!-- SNIP menubar code -->
     </toolbox>
	...
         <!-- Feed Listing Area -->
         <vbox flex="1">
  	<!-- SNIP tree code here -->
	</vbox>
	
	<!-- Splitter here -->
	
        <vbox flex="4">
             <browser id="parsed-rss-feed" flex="1" onload="return true;"/>
	</vbox>
</vbox>
</window>

habarixenu.js
-------------

function buildTreeFromDataSource() {
     // SNIP code

     var browser = window.frames[0].document;
     // var browser = window.frames['parsed-rss-feed'].document;

     browser.open();
     browser.write('<html><head></head><body><b>Hello</b></body></html>');

     browser.close();
}

My question is, why does it keep getting into buildTreeFromDataSource() ?

Thanks.

Thaths
-- 
"Okay, brain. You don't like me, and I don't like you, but let's get
through this thing and then I can continue killing you with beer."
                       -- Homer J. Simpson
Slacker Without Borders                        http://openscroll.org/
Key fingerprint = 8A 84 2E 67 10 9A 64 03  24 38 B6 AB 1B 6E 8C E4


More information about the Project_owners mailing list