Chapter 10: Messaging and Workers

Remy Sharp

WEB MESSAGING AND WEB WORKERS are different APIs but all have the same communication API, which is why I will discuss them together. Only the Messaging API is part of the official HTML5 spec, but both of these APIs are valuable additions to any web application.

Messaging allows applications to send messages from one domain to another, something that Ajax security policies have long prevented for good reason, but is now starting to open up with the right security measurements in place.

Browsers are effectively single-threaded applications, in that when JavaScript is running or perhaps being parsed, the page isn’t rendering. Equally, when JavaScript is performing a long and complicated function, the ...

Get Introducing HTML5, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.