Web Messaging: Difference between revisions

Content deleted Content added
Created page with '{{HTML}} '''Cross-Document Messaging''', or '''web messaging''', is an API introduced in the WHATWG HTML5 draft specification, allowing documents to com...'
 
No edit summary
Line 1:
{{HTML}}
'''Cross-Documentdocument Messagingmessaging''', or '''web messaging''', is an [[API]] introduced in the [[WHATWG]] [[HTML5]] draft specification, allowing documents to communicate with one another across different origins, or source domains.<ref name="WHATWG"/> Prior to HTML5, web browsers disallowed [[cross-site scripting]], to protect against security attacks. This practice barred communication between non-hostile pages as well, making document interaction of any kind difficult.<ref name="WHATWG"/><ref name="WebKit"/> Cross-Document messaging allows scripts to interact across these boundaries, while providing a rudimentary level of security.
==Requirements and Attributes==
Using the Messaging API's <code>postMessage</code> method, plain text messages can be sent from one domain to another.<ref name="INTRODUCING"/> This requires that the author first obtain the <code>Window</code> object of the receiving document. As a result, messages can be posted to the following:<ref name="WebKit"/>