I have an iframe loaded inside a parent page - the iframe and parent page are on different domains.
Can my iframed site detect the actual browser dimensions?
I have an iframe loaded inside a parent page - the iframe and parent page are on different domains.
Can my iframed site detect the actual browser dimensions?
You can use the web API window.postMessage
method too. It safely enables cross origin communication.
https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage
The simple answer, is no. It cannot. Unless by some means the parent window can dynamically send data to the object inside the iframe...
However if the content inside the iframe was all made in %'s so that it would scale nicely (similar to a fluid web page layout), this could help?
What is it that you are directly trying to achive?
I ended up using the excellent postMessage plugin from Ben Alman
http://benalman.com/projects/jquery-postmessage-plugin/
this allows for cross domain communication where you have control over both domains.