acquire a named web lock · open a second tab · watch it queue · release · cross-tab coordination with zero server involvement · runs locally
the web locks api lets any two tabs of the same origin coordinate exclusive access to a named resource — with no server, no websocket, no shared worker. one tab holds the lock; all others queue. open this page in a second tab and try acquiring the same lock from both.
✦ open this page in a second tab for the full cross-tab demo
polled via navigator.locks.query() every 800 ms
locks.query() shows which client ids hold or are waiting for any named lock — including locks created by other tabs for unrelated purposes. any page can observe lock contention across the whole origin.