Hi Everyone,

I am currently looking at Mozilla as a platform for applications using XUL. I have written a quick prototype and was very impressed with the ease of development (along with the hidden power).

I am now looking at how I will be deploying the application. Everything that I have tried so far has failed because of a number of errors. Below is each option I have tried to get a running standalone application. There are 3 bugs which are stopping me in various ways.
_
Mozilla ActiveX_


According to the website (http://www.iol.ie/~locka/mozilla/control.htm) the control supports all the same features as the IE WebBrowser Object. It does not. Only a very small subset of the WebBrowser functionality is implemented.

_MFC_

MFCEmbed suffers from the document.write crashing bug.

_GtkEmbedMoz#_

This also seems to suffer from the same crashing bug as MFC.

_Recompile Firefox (from CVS sources)_

Suffers from the broken multiple select bug and the second document.write bug.

_Launch firefox using the -chrome flag_

Works perfectly except on machines with Firefox already installed. On those machines, when you try to open firefox after my application, you only get my application (not the chrome://browser/content/)

_XUL Runner

_This fails to compile on windows. Im not sure if this is in development or not, so havent looked too hard into getting it to work.



Now a description of the 3 bugs that are stopping me.

_1. The document.write crashing error._

The application I have written is a screen scraping tool. Basically it has a XUL window with a <browser> element which is used to render HTML from websites which is retreived using XMLHTTPRequest. A number of requests are sent off asynchronously, when they are returned the HTML is written to the browser using the following code.

       browser = document.getElementById('browser-helper');
       browser.contentWindow.document.open();
       browser.contentWindow.document.write(txt);
       browser.contentWindow.document.close();

On one of the urls that I retreive, the application crashes. The url is http://easyjet.com/en/book/index.asp . It does not crash on first write, I can prevent it crashing by truncating txt to 40000 characters. There is a lot of javascript in this page, so it might be something to do with that. This bug does not occur on releases of firefox or my builds (only MFC and Gtk#). In the example above txt is just the text received from the above url.

2. The nested select error

One cool feature of XUL is the ability to make nested select (menulist) elements, unfortunatly they do not seem to work as I expect. I expect that a nested menulist should show the value of the sub menu item that was selected, but it just returns to the previously selected main tree item. This is easy to fix with a bit of javascript.

The XUL code

                           <menulist id="fa">
                               <menupopup>
                                   <menuitem value="" label="Select..."/>
                                   <menu id="sub_menu">
                                     <menupopup id="fa_sub">
                                     </menupopup>
                                   </menu>
                               </menupopup>
                           </menulist>

the JS

I populate the menulist dynamically attaching an onclick to the child.

           mi.setAttribute('onclick', 'populate_sub(this)');

function populate_sub(mi){
   menu = document.getElementById('fa');
   menu.label = mi.label;
   menu.value = mi.value;
}

This bug does nothing (ie populate_sub doesnt seem to be called). It works as expected on release builds, but not on MFC etc.

_3. The second document.write bug_

Im not too sure about this one, but it seems to happen regularly.

Carrying on from the document.write bug... When I have written the document to the browser, it doesnt render the second time that I open and write to the document. The document just shows up blank white.

Id appreciate any feedback anyone has on these bugs, please write to me off list if you would like any more examples or debugging help.

Mike
_______________________________________________
mozilla-embedding mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to