This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23993 - window.addEventListener('message', receiver, false); function receiver(e) { if (e.origin == 'http://example.com') { if (e.data == 'Hello world') { e.source.postMessage('Hello', e.origi [...]
Summary: window.addEventListener('message', receiver, false); function receiver(e) { ...
Status: RESOLVED NEEDSINFO
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
: 23994 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-04 03:33 UTC by contributor
Modified: 2013-12-04 21:56 UTC (History)
2 users (show)

See Also:


Attachments

Description contributor 2013-12-04 03:33:23 UTC
Specification: http://www.w3.org/TR/2012/CR-webmessaging-20120501/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top
Referrer: 

Comment:
window.addEventListener('message', receiver, false);
function receiver(e) {
  if (e.origin == 'http://example.com') {
    if (e.data == 'Hello world') {
      e.source.postMessage('Hello', e.origin);
    } else {
      alert(e.data);
    }
  }
}

Posted from: 122.87.144.75
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36
Comment 1 Ian 'Hixie' Hickson 2013-12-04 21:55:48 UTC
Can you elaborate?
Comment 2 Ian 'Hixie' Hickson 2013-12-04 21:56:08 UTC
*** Bug 23994 has been marked as a duplicate of this bug. ***