XULrunner: in web pages

Closed Forum
Posts: 1
Joined: May 28th, 2006, 9:40 am

Post Posted May 28th, 2006, 10:10 am

I'm writing a small site specific browser that for all intents and purposes looks like this:

<browser id="content" flex="1"/>

I'm trying to support statements in the remote pages. But I get:

Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) []

I've tried a whole lot of approaches, but the one that gets me the closest is putting the following code in an onload handler:

document.getElementById('content').open = function() { window.openDialog("chrome://window.xul","","dialog=no,all",arguments[0]);

where arguments[0] is the url to open, and there is javascript in window.xul to fetch this parameter and open the page in it's browser element.

Now this works fine, until the page is refreshed or the location changes (as you'd expect).

I've tried using progress listeners to put the method back on state change, but no matter what I do, I can't override the browser elements method more than once.

The whole approach I'm taking is very ugly. More than likely I'm exploiting a bug, there must be an easier way. Does anyone know how to handle calls in remote web pages (not chrome urls) in xulrunner?

Any help would be much appreciated. I've been searching for days without success.



Post Posted June 5th, 2006, 12:43 pm

I too am having similar problems and would appreciate any help.

Posts: 1
Joined: June 27th, 2006, 11:11 pm
Location: Atlanta, GA

Post Posted June 27th, 2006, 11:16 pm

I ran into a similar issue a few months ago. Alas, I never got back to working on it. However, I did get some helpful pointers from bsmedberg on the #xulrunner IRC channel. He was working through something related late last year:

You might try to catch him. Do post the solution if you get to it.


Posts: 50
Joined: August 29th, 2004, 12:12 pm

Post Posted January 4th, 2007, 3:37 am

I also add the same problem, and tried different approaches.

But at the end, I managed to find an easy way :
just add that preference in your preferences files :
pref("browser.chromeURL", "chrome://browser/content/browser.xul")

(or whatever the url of your main window is)

Return to Miscellaneous Support

Who is online

Users browsing this forum: No registered users and 1 guest