Help centre
Answer
What is the Web Locks API for?
Short answer
The Web Locks API lets scripts across multiple tabs, workers or a service worker of the same origin coordinate exclusive or shared access to a named resource, so only one context runs a given operation at a time — for example, preventing two open tabs of a PWA from both triggering the same background-sync network request simultaneously.
By InstantPWA engineering·Reviewed July 25, 2026
How it works
navigator.locks.request("resource-name", async lock => { ...work... }) queues callers so only one holds the lock at a time; a "shared" mode also allows multiple concurrent readers.
Typical PWA use case
Coordinating IndexedDB writes or background-sync tasks across multiple open tabs so they do not race each other or duplicate work.
Support
Widely supported in Chrome, Edge, Firefox and Safari as of recent versions.
Sources
Related
What is the Background Sync API?
The Background Sync API lets a service worker register a task that the browser retries automatically once the device is back online, even if the user has closed the tab. It is commonly used so a form submission or message made while offline is not lost — it queues, then fires the moment connectivity returns.
IndexedDB vs localStorage: which should a PWA use?
localStorage is a simple synchronous key-value store limited to strings and roughly 5-10MB, and it is not accessible from inside a service worker. IndexedDB is an asynchronous, transactional database that can store structured objects, blobs and much larger amounts of data, and it is accessible from both the page and the service worker — making it the right choice for most PWA data storage.
What is the app install banner (mini-infobar)?
The mini-infobar is a small automatic prompt Chrome for Android can show at the bottom of the screen once a site meets install criteria and engagement heuristics, offering a one-tap install without opening the browser menu. Developers can call preventDefault() on the beforeinstallprompt event to suppress it and instead show their own custom "Install" button, triggering the native dialog later at a more relevant moment.
Is a responsive website the same as a PWA?
No, they solve different problems. Responsive design means your layout adapts to different screen sizes using CSS (media queries, flexible grids). A PWA is about adding installability, offline support and push notifications through HTTPS, a Web App Manifest and a service worker. A site can be responsive without being a PWA, and in principle a PWA could be built without fully responsive layout, though in practice almost every PWA is also responsive.
Can you monetize a PWA?
Yes. A PWA can process payments the same way any website does — with a payment processor like Stripe or PayPal, optionally streamlined with the Payment Request API for a native-feeling checkout sheet. Because PWAs are not distributed through an app store by default, sites can take payments without paying Apple’s or Google’s in-app-purchase commission, which only applies to purchases made inside a native app-store listing.