Hi,
I'm writing a small site specific browser that for all intents and purposes looks like this:
<window>
<browser id="content" flex="1"/>
</window>
I'm trying to support window.open() statements in the remote pages. But I get:
Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]
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 window.open method back on state change, but no matter what I do, I can't override the browser elements window.open 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 window.open calls in remote web pages (not chrome urls) in xulrunner?
Any help would be much appreciated. I've been searching for days without success.
Andrew
XULrunner: window.open in web pages
-
- Posts: 1
- Joined: June 27th, 2006, 11:11 pm
- Location: Atlanta, GA
- Contact:
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:
http://wiki.mozilla.org/DocShell:Window_targeting
You might try to catch him. Do post the solution if you get to it.
Cheers,
Coty
http://wiki.mozilla.org/DocShell:Window_targeting
You might try to catch him. Do post the solution if you get to it.
Cheers,
Coty
-
- Posts: 50
- Joined: August 29th, 2004, 12:12 pm