Chrome cross-window communication

1.8k views Asked by At

I have a HTML5 Framework and have developed and integrated debugger/profiles/console ect. When in fullscreen mode I cannot see the debugger (obviously because the canvas is fullscreen). So, I need to do another tab or popup so the debugger can be moved off to another monitor or whatever. But, the debugger needs to be able to access (monitor) the window or tab that opened it.

My only other option is to not allow fullscreen when the debug version of the framework is loaded, but that is not the path I want for various reseaons. So basically my question is, Can I have a window (webapp) open a popup (debugger) and have that popup access the opening window (webapp)?

2

There are 2 answers

3
Avinash Singh On BEST ANSWER

Yes you can do it , browsers block it due to the security reasons if the parent and child window originate from different domain.

set this on both pages if they are running on different domain and you have control over both parent and child window code.

document.domain = '.xyz.com';

You can call the child window objects like ,

winobj=window.open('child window') 
...
winobj.document.getElementById("elementname").value=""

and parent window like ,

window.opener.functionname(a,b) or window.opener.buttonid.name

Please have a look into respnse header 'Access-Control-Allow-Origin' to allow cross domain scripting on the other domains where you don't have control over parent or child windows domain and they are different.

0
Kernel James On

How about by opener property?

opener.runFunction();