<div class="gmail_quote">On Tue, Jan 5, 2010 at 9:34 PM, Michael A. Puls II <span dir="ltr"><<a href="mailto:shadow2531@gmail.com">shadow2531@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, 05 Jan 2010 23:29:40 -0500, Dirk Pranke <<a href="mailto:dpranke@chromium.org" target="_blank">dpranke@chromium.org</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As an alternative, would it be possible to create an onChildLoad()<br>
event in the parent so that the parent could reliably send a message<br>
without needing the child's cooperation? These seems only marginally<br>
better than having the child post to the parent, so it may not be<br>
worth it ...<br>
</blockquote>
<br></div>
In Firefox, you can do stuff like this:<br>
<br>
var w = window.open("handler.html");<br>
w.addEventListener("DOMContentLoaded", function(e) {<br>
var targetWin = e.target.defaultView.<br>
targetWin.postMessage("Hello", "domain");<br>
}, false);<br>
<br>
But, I think that only works in Firefox. In Opera at least, I'm sure it doesn't work.<br><br></blockquote><div><br></div><div>The same thing works fine in WebKit-based browsers as well. However, this solution only works when the newly opened document is in the same origin as the opener.</div>
<div><br></div><div>-Darin</div></div>