I have written a tool for taking notes, grabbing images from web pages. It loads itself as a iFrame within the current window by using a javascript bookmark:
postMessage is probably what you're looking for. Mozilla has documented this and it has fairly decent cross browser support:
https://developer.mozilla.org/en-US/docs/DOM/window.postMessage
I also wrote a library around this concept, it may need a little debugging but it is available on github: https://github.com/tsharp/OF.Core.js/blob/master/js/of/window.messaging.js
From here you'll need an event listener on the parent window to handle all incoming requests ... which will remove the iframe from the parent context. Here is an example of registering the message received event.
function registerWindowHandler() {
if (typeof window.addEventListener !== 'undefined') {
window.addEventListener('message', receiveMessage, false);
} else {
// Support for ie8
window.attachEvent('onmessage', receiveMessage);
}
}