0

It seems window.postmessage that don't support authorization using username and password. (See)

How can I authorize in postmessage like XMLHTTPRequest().open() meethod.(See)

Thanks.

kinakomochi
  • 445
  • 3
  • 8
  • 14
  • Not. `postMessage` is used to pass messages to **existing frames/windows**. It does not initiate a new request to the server. – Rob W Aug 12 '12 at 08:57
  • Thanks. I got it. Is there any way to authorize using postMessage not against cross-origin-pricy. – kinakomochi Aug 12 '12 at 09:05
  • 1
    `postMessage` must specify a `targetOrigin` parameter. When the target frame does not match this parameter, the message is not received. The `onmessage` event receives an `origin` property. You can use this value to see if the origin is allowed to make requests. When you have control over both pages, you might be able to implement a kind of authorization. – Rob W Aug 12 '12 at 09:13
  • I totally understood. I try that one. Thanks! – kinakomochi Aug 13 '12 at 02:37

0 Answers0