20JavaScript APIs

WHAT'S IN THIS CHAPTER?

  • Atomics and SharedArrayBuffer
  • Cross-context messaging
  • Encoding API
  • File and Blob API
  • Drag and drop
  • Notifications API
  • Page Visibility API
  • Streams API
  • Timing APIs
  • Web components
  • Web Cryptography API

The increasing versatility of web browsers is accompanied by a dizzying increase in complexity. In many ways, the modern web browser has become a Swiss army knife of different APIs detailed in a broad collection of specifications. This browser specification ecosystem is messy and volatile. Some specifications like HTML5 are a bundle of APIs and browser features that enhance an existing standard. Other specifications define an API for a single feature, such as the Web Cryptography API or the Notifications API. Depending on the browser, adoption of these newer APIs can sometimes be partial or nonexistent.

Ultimately, the decision to use newer APIs involves a tradeoff between supporting more browsers and enabling more modern features. Some APIs can be emulated using a polyfill, but polyfills can often incur a performance hit or bloat your site's JS payloads.

ATOMICS AND SharedArrayBuffer

When a SharedArrayBuffer is accessed by multiple contexts, race conditions can occur ...

Get Professional JavaScript for Web Developers, 4th 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.