What happens when a HTML link containing JavaScript code (using
window.open) to open a new window is clicked inside a browser element/
instance?
I take it that it creates a new "browser.chromeURL" window; but how
then is it supposed to load it into a new browser tab in the new
window?
I figured that browserDOMWindow.openURI would get called in the new
window but it is not in my xulrunner app.
Currently when the link is clicked and a new browser window is
created, the URI loads, it triggers an unload event and the whole xul
window/widgets are replaced with the website document.
How can I direct it to my function in the new window to create a new
tab inside this window?
Thanks,
James
>What happens when a HTML link containing JavaScript code (using window.open) to open a new window is clicked inside a browser element/instance?
>
>I take it that it creates a new "browser.chromeURL" window; but how then is it supposed to load it into a new browser tab in the new window?
>
>
Your new window should already have a browser (tab) at this point. Did
you remember to set type="content-primary" on the browser (tab)?
>I figured that browserDOMWindow.openURI would get called in the new window but it is not in my xulrunner app.
>
>
It gets called in the existing window, although the URI is not passed to
it any more; instead it internally opens the URI in the window that
openURI returns.
--
Warning: May contain traces of nuts.
I've created my own basic tab browser binding not based on tabbrowser
and it doesn't necessarily have a tab open when the window loads. Yes
the selected browser element always has content-primary.
So your saying browserDOMWindow.openURI should get called from the
chrome window in which the link on the browser element was called?
The following snippet of code is initialised when the window loads but
the alert in openURI is never triggered. Am I setting this up wrong or
it opens some other way? Then can you suggest a way for me to
"capture" the new windows?
var BrowserDOMWindow = {
initialise: function() {
window.QueryInterface(CI.nsIDOMChromeWindow).browserDOMWindow =
this;
...
openURI: function(URI, opener, where, context) {
alert("openURI");
...
Thanks,
James