Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum size for the postMessage method that enables inter-frame communication?

It's not clear from searching on Google and looking through documentation. What's the maximum length on a message sent via Window.postMessage (https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage)? We assume this varies by browser?

like image 536
Crashalot Avatar asked Dec 12 '13 00:12

Crashalot


People also ask

What is iframe postMessage?

postMessage() method safely enables cross-origin communication between Window objects; e.g., between a page and a pop-up that it spawned, or between a page and an iframe embedded within it.

What is postMessage?

postMessage() is a safe way to send messages between windows in different domains or origins. One can also post to an IFrame. The data being sent is serialized using the structured clone algorithm and will accept almost any type of simple or complex data.

How do you communicate between two iframes?

Communicating directly between iframes is also possible by combining window. parent with target as defined above. In conclusion, the postMessage method is a more dynamic alternative to the single DOM, better suited if you load multiple pages in one iframe, but not always easier and it still requires the use of the DOM.

Is window postMessage secure?

Security-Reviewing Uses of postMessage() postMessage is generally considered very secure as long as the programmer is careful to check the origin and source of an arriving message. Acting on a message without verifying its source opens a vector for cross-site scripting attacks.


1 Answers

As a data point, the WebKit implementation (used by Safari and Chrome) doesn't currently enforce any limits (other than those imposed by running out of memory).

Source : https://lists.w3.org/Archives/Public/public-whatwg-archive/2009Oct/0546.html

like image 91
Kamlesh Shirbhate Avatar answered Sep 21 '22 22:09

Kamlesh Shirbhate