Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Provides cross-frame messaging support in major browsers including IE 6.
Latest commit 8b40990 @josephj Update

CrossFrame Utility

The CrossFrame module adds HTML5 Web Messaging feature for legend browser including IE6 and IE7. It also creates same API interface for all browsers no matter they support HTML5 Web Messaging or not.

  • Use Y.CrossFrame.postMessage() instead of window.postMessage.
  • Use Y.Global.on("crossframe:message") instead of window.onmessage.

Because there must be some legend browsers which don't support postMessage, you have to provide a proxy file which is at same domain with the receiving iframe. Download the proxy file:

NOTE: The original idea is from Julien Lecomte's "Introducing CrossFrame, a Safe Communication Mechanism Across Documents and Across Domains.


Demo Page -

  • Sender uses Y.CrossFrame.postMessage()

     YUI().use("crossframe", function (Y) {
          Y.CrossFrame.postMessage("frames['<FRAME NAME>']", <MESSAGE>, {
               "proxy": "http://<DOMAIN OF TARGET IFRAME>/proxy.html"
  • Receiver uses Y.Global.on("crossframe:message")

     YUI().use("crossframe", function (Y) {
          Y.Global.on("crossframe:message", function (e, data, callback) {
Something went wrong with that request. Please try again.