tidied off domain postmessage shim code