Let's say there's a function in the top window. For example:
function z() { alert(window.name); }
Let's also say there's an iframe in this document (same origin).
Can a function in the top window execute this function in the context of another window, such that it displays the name of the iframe and not the top window?
In other words, how is the global object bound to a function and can it be changed?
Naive attempt that doesn't work: https://jsfiddle.net/wos2o3gx/ (displays top for both invocations).