Service Worker Debugger - Online View States & Update
See the current Service Worker registration, its state, and scope. Send 'skipWaiting' and update. PWA debug.
UD5 Toolkit
install event fires â ideal for caching assets), Installed / Waiting (SW is installed but waiting for existing SW to release control), Activating (the activate event fires â ideal for cleaning old caches), Activated (SW controls the page and can intercept fetch requests), and Redundant (SW is being replaced or has failed). Understanding this flow is critical for proper SW debugging.
install event, the Service Worker typically pre-caches critical assets (HTML, CSS, JS, images) using the Cache API. This is the best time to cache resources needed for offline functionality. The install phase should be as fast as possible â if it fails, the SW won't proceed to the activation stage. Use event.waitUntil() to extend the install phase until caching is complete.
activate event is the perfect place to clean up old caches from previous SW versions, migrate indexedDB schemas, and claim uncontrolled clients. Use event.waitUntil() to keep the SW in the activating state until cleanup is complete. This ensures that outdated cached resources don't interfere with the new SW version.
self.skipWaiting() inside the SW script.
self.skipWaiting() forces the Service Worker to skip the Waiting phase and immediately proceed to Activating as soon as installation completes â even if there are active tabs using an older SW. It's commonly used with clients.claim() to ensure the new SW takes control immediately. Use with caution: it can cause version conflicts if not handled carefully.
clients.claim() tells the newly activated Service Worker to immediately take control of all already-open pages within its scope. Without it, the new SW only controls pages that are loaded after activation. Combine with self.skipWaiting() for seamless updates where the new SW instantly controls all clients.
registration.update(). If a new SW is found, it goes through install â waiting â activate (when old SW releases control). The update check happens at most once every 24 hours by default.
Application â Service Workers to see all registered SWs, their states, and logs. Check the Console for SW errors. Use chrome://serviceworker-internals/ for detailed inspection. Firefox: Use about:debugging#/runtime/this-firefox. Always enable "Update on reload" during development, and use navigator.serviceWorker.getRegistrations() in the console to inspect SWs programmatically.
/app/sw.js can only control pages under /app/. To control the entire origin, serve the SW from the root (/sw.js). The scope can be restricted further using the scope option in navigator.serviceWorker.register(), but it cannot be broader than the SW's location.
registration.unregister() is called, (4) the SW script returns a 404 or network error on update check, or (5) the SW throws an unhandled exception. Once redundant, the SW is permanently dead and a new registration is needed.
See the current Service Worker registration, its state, and scope. Send 'skipWaiting' and update. PWA debug.
List all resources loaded by the current page and their detailed timing breakdown. Inâbrowser waterfall.
Paste a raw server log snippet and see a structured table with IP, method, URL, and status. Quick audit.
Set up multiple @layers and use revertâlayer to fall back. See the computed style and cascade resolution live.
Access the Paint Timing API and display First Paint, First Contentful Paint, and Largest Contentful Paint times. Quick perf check.
See your device's battery level, charging status, and discharge time using the Battery Status API. Fun utility.
Build a renovate.json file to automate dependency updates. Choose schedule, automerge, and package rules. Local.
Log shedding events, note duration, and track humidity to optimize next cycle. Healthy scales.
Estimate how long a battery will last given capacity (mAh/Wh) and load current. Also computes backup time for power banks. Quick and local.
Connect to a BLE device and read its Battery Service characteristic. See the charge level in a gauge.
Schedule tasks with userâvisible, userâblocking, or background priority. See execution order and delays. Modern web perf.
Estimate arrival time with driving duration, breaks, and time zone changes. Plan your road trip precisely.
Enter network name and password to generate a stylish printable card for visitors. Local, no data leak.
A completely black page to save battery on OLED devices. Click to go fullscreen. Simple utility.
Load images or use colors and apply all 15 CSS blend modes. Visual tester for creative effects.
Swap between physical and logical properties (marginâinline vs marginâleft). Live preview with writingâmode. Internationalize your CSS.
Paste your CSS and see rules sorted by specificity. Find overrides and potential collisions. Understand your cascade.
Set an alarm relative to today's sunset (e.g., 30 minutes before). Perfect for evening routines. Uses geolocation (optional).
Create promises that resolve or reject after a delay. See state changes and chain .then/.catch. Debug async code.
Enter a URL and instantly generate a PDF version using the browser's print-to-pdf engine. Private, no upload.
Manipulate CSS values as typed objects using attributeStyleMap. Convert between CSSUnitValue, CSSMathSum, etc. Futuristic CSSâinâJS.
Enter a URL and instantly generate a PDF version using the browser's print-to-pdf engine. Private, no upload.
Apply willâchange to any element and see its effect on compositing. Learn best practices for smooth animations.
Get a random, unique superpower with a detailed description and limit. Perfect for character creation or daydreaming.
Register a custom CSS property with syntax, initial value, and inherits. Animate colors and numbers that couldnât before.
Calculate flour, water, starter amounts to achieve a target loaf hydration. Adjusts for starter hydration. Instant local calculation.
Write CSS with native nesting (like SCSS) and see the browserâs native parsing. Validator and live output.
Paste your CSS and get a sorted list of all custom properties defined under :root with their values. Quick audit.
Easily compute posterior probabilities given prior, likelihood, and marginal likelihood. Visual diagram. All local.
Test the new style() function inside @container to query custom property values. Revolutionary componentâbased responsive design.