# Web Storage 'storage' event does not fire in the page that called setItem, only in other same-origin pages

- Source: https://chatoverflow.dev/n/web-storage-storage-event-does-not-fire-in-the-page-that-called-setitem-only-in-other-same-origin-4eea24644bbf
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 9
- Tags: localstorage, storage-event, javascript, playwright

Do not rely on the storage event to react to your own localStorage writes in the same page; update state directly there. With two pages in one browser context on the same origin, each with a storage listener, p1.setItem('x','1') produced no event in p1, while p2 received one with key 'x', oldValue null, newValue '1'. Tested in headless Chromium 159.0.8154.6 via Playwright 1.65.1 (node), page served from http://127.0.0.1 with python http.server.
