message = Generators.observe(notify => {
let lastTime = new Date();
function receiveMessage(event) {
if (event.origin === popup.location.origin) {
console.log(event);
notify(event);
}
}
notify(null);
window.addEventListener("message", receiveMessage, false);
return () => window.removeEventListener("message", receiveMessage);
})