# Browser APIs: storage, fetch, timers and workers

*JavaScript Developer Study Guide · Browser and Events · Last updated October 16, 2026 · https://www.certifyforce.com/study-guide/javascript-developer/browser-and-events/browser-apis-storage-fetch-timers-and-workers*

Pick the browser API a requirement calls for: localStorage versus sessionStorage and the cross-tab storage event, fetch's resolve-on-404 rule and AbortController timeouts, debouncing with timers, requestAnimationFrame, IntersectionObserver, Web Workers, the History API and URLSearchParams, Geolocation and the Page Visibility API.

- Certification: Salesforce JavaScript Developer
- Exam section: Browser and Events
- Study guide: https://www.certifyforce.com/study-guide/javascript-developer

**Official exam objective:**

> Given a scenario and requirements, utilize browser specific APIs.

## What the exam expects

- Store and read data with `localStorage` and `sessionStorage`, serializing objects, and sync tabs with the `storage` event.
- Call `fetch()` correctly: check `response.ok`, catch network failures, and add a timeout with `AbortController`.
- Schedule work with `setTimeout`/`clearTimeout` (debounce), `requestAnimationFrame`, `IntersectionObserver` and Web Workers.
- Route a single-page app with `history.pushState` and `popstate`, navigate with `location.replace`, and read query strings with `URLSearchParams`.
- Use Geolocation and the Page Visibility API within their permission and event rules.
- Key terms: **Web API** (a browser-provided interface, not part of the JavaScript language); **origin** (scheme, host and port that partition storage); **debounce** (run only after input pauses); **main thread** (where page JavaScript, rendering and input share time); **session history** (the entries Back and Forward move through).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Web Storage values | Always strings; serialize objects with `JSON.stringify()` | [Using the Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API) |
| `localStorage` vs `sessionStorage` | Origin-wide and persistent vs per tab, cleared when the tab closes | [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) |
| `storage` event | Fires in other same-origin windows, never the one that changed storage | [storage event](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event) |
| `fetch()` on 404 or 500 | Resolves; check `response.ok` or `status` | [fetch()](https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch) |
| Aborted `fetch()` | Rejects with `DOMException` named `AbortError` | [fetch()](https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch) |
| `requestAnimationFrame` | One-shot, before next repaint, paused in background tabs | [requestAnimationFrame()](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame) |
| Web Worker limits | No direct DOM access; messages are copied | [Using Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) |
| `pushState()` | Changes URL without loading it; same origin only; no `popstate` | [pushState()](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState) |
| `location.replace()` | Current page is not kept in session history | [Location.replace()](https://developer.mozilla.org/en-US/docs/Web/API/Location/replace) |
| `URLSearchParams.get()` | First value as a string, or `null` | [URLSearchParams.get()](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/get) |
| Geolocation | HTTPS only, user permission, callbacks, returns `undefined` | [getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) |

## Check yourself

- Why does a cross-tab logout listener never fire during a one-tab test?
- When does a `fetch()` promise reject?
- Why must an animation callback call `requestAnimationFrame` again?
- Which navigation call keeps an interstitial page out of the Back history?
- How does a Web Worker return its result to the page?

## Sources

- [Web APIs](https://developer.mozilla.org/en-US/docs/Web/API)
- [Introduction to web APIs](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Client-side_APIs/Introduction)
- [Using the Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API)
- [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API)
- [Window: storage event](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event)
- [Window: fetch() method](https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch)
- [Using the Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch)
- [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)
- [Window: setTimeout() method](https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout)
- [Window: requestAnimationFrame() method](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame)
- [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)
- [Using Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers)
- [History: pushState() method](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState)
- [Window: popstate event](https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event)
- [Location: replace() method](https://developer.mozilla.org/en-US/docs/Web/API/Location/replace)
- [URLSearchParams: get() method](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/get)
- [Geolocation: getCurrentPosition() method](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)
- [Page Visibility API](https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 13 linked practice questions, and unlimited timed mock exams are included with the JavaScript Developer pack (USD $19): https://www.certifyforce.com/practice-exams
