Added origin checks to postmessage.