Periodic Background Sync Registration - Online PWA Tool
Register a periodic background sync with a minimum interval. See the registration state and tags. Keep content fresh.
UD5 Toolkit
Register, test, and monitor Periodic Background Sync API for your PWA
Create a new periodic background sync task
One-click common sync configurations
self.addEventListener('periodicsync', (event) => {
console.log('[SW] Periodic Sync triggered:', event.tag);
if (event.tag === 'news-update') {
event.waitUntil(
fetch('/api/latest-news')
.then(res => res.json())
.then(data => {
// Cache or post message to clients
return clients.matchAll({ type: 'window' })
.then(clients => {
clients.forEach(client => {
client.postMessage({
type: 'SYNC_COMPLETE',
tag: event.tag,
data: data
});
});
});
})
.catch(err => console.error('[SW] Sync failed:', err))
);
}
// Handle other tags...
});
registration.periodicSync.register(tag, opts) | Register a new periodic sync with tag name and {minInterval} in ms. |
registration.periodicSync.unregister(tag) | Remove a previously registered periodic sync by tag name. |
registration.periodicSync.getTags() | Returns Promise<string[]> of all registered sync tag names. |
navigator.permissions.query({name:'periodic-background-sync'}) | Check permission state: granted, denied, or prompt. |
| Chrome minInterval (dev) | ~10 seconds on localhost with flags enabled. |
| Chrome minInterval (prod) | 12 hours (43,200,000 ms) minimum for installed PWAs. |
| Site Engagement | Chrome requires sufficient site engagement score for periodic sync to fire. |
Periodic Background Sync allows a PWA to periodically fetch fresh content in the background, even when the user isn't actively using the app. It's designed for regular updates like news feeds, weather data, or stock prices.
Background Sync (one-off sync) is different — it's designed for deferred actions. When a user performs an action while offline (like sending a message), Background Sync queues it and sends it when connectivity returns. Periodic Sync is time-based and recurring; Background Sync is connectivity-based and one-shot.
| Feature | Periodic Background Sync | Background Sync |
|---|---|---|
| Trigger | Time interval | Network recovery |
| Frequency | Recurring (min ~12h in prod) | One-shot per registration |
| Use Case | Content pre-caching | Offline action queue |
| PWA Required | Yes (installed) | No |
localhost for development).periodicsync event listener is required.periodic-background-sync permission must be granted (usually implicit upon PWA install).If your periodic sync isn't triggering, check these common issues:
window.matchMedia('(display-mode: standalone)').matches.chrome://site-engagement/ to check your site's score.self.addEventListener('periodicsync', ...).chrome://serviceworker-internals/ for more detailed debugging. Tip: In development (localhost), you can reduce minInterval to as low as ~10 seconds by enabling chrome://flags/#periodic-background-sync experimental features.
Periodic Background Sync excels in these scenarios:
Avoid using it for real-time critical data (use WebSockets) or very frequent updates (respect user's data and battery).
Yes! Periodic Background Sync works on Android devices with Chrome 80+ installed. The PWA must be added to the home screen.
On iOS, support is limited. As of 2025, Safari on iOS does not support the Periodic Background Sync API. PWAs on iOS have more restricted background capabilities. Consider using alternative strategies (like silent push notifications or Background Fetch API where available) for iOS users.
Always implement feature detection and provide graceful fallbacks for unsupported platforms.
There is no hard limit defined by the specification, but Chrome imposes a soft limit. In practice:
getTags() to audit your registered syncs and clean up obsolete ones with unregister().Register a periodic background sync with a minimum interval. See the registration state and tags. Keep content fresh.
Register a periodic background sync to fetch fresh data even when the tab is closed. Understand the API and limits.
Connect an audio source to an Analyzer Node and display frequency and time‑domain data. Learn Web Audio visualization.
Write a pattern and test it against URLs instantly. See which groups match. Learn the modern alternative to regex for routing. Works entirely in the browser.
Paste text to see a live letter frequency bar chart. Helps break substitution ciphers. All local analysis.
Play a sweep from 20Hz to 20kHz. Test your speakers and your hearing. Simple and effective. Web Audio API.
Complete a series of visual pattern puzzles and get a fun estimated score. Purely for entertainment. No data collected.
Pomodoro timer with built‑in lo‑fi music playlist (synthetic). Focus and rest cycles. No copyright music; generated tones.
Pick a method, URL, headers, and body, then send an HTTP request directly from your browser. Debug APIs easily.
Select HTTP method, set headers, and body. Send requests and see the full response. Lightweight Postman alternative.
Mix white noise, pink noise, rain, thunder, wind, and cafe sounds. Individual volume, save presets. Relax or focus. All client‑side.
Mix multiple ambient sounds (rain, fireplace, cafe, forest) at different volumes. Create your perfect background noise. Local loops.
Trigger different vibration patterns on mobile devices. Test if your phone supports haptic feedback. Simple demo.
Select color bands to decode a resistor's value, tolerance, and temperature coefficient. Essential for anyone working with electronics hardware.
Play a selection of local lo‑fi tracks (embedded). Simple UI with play/pause. No copyright issues. Stay focused.
Read the ambient atmospheric pressure in hPa using the Pressure Sensor API (if available). Real‑time graph.
Use the Magnetometer API to build a digital compass. See magnetic field strength and heading in real time.
Experiment with the experimental Prompt API and Summarization API right in your browser. See how the on‑device AI model responds. Requires Chrome with AI features enabled.
Zoom through the electromagnetic spectrum from radio waves to gamma rays. See wavelength, frequency, and applications. Static educational page.
Load an audio file and see its spectrogram with frequency over time. Adjust resolution and color map. Discover hidden sounds.
Enter text and generate the corresponding Morse code audio beeps. Adjust speed and tone. Great for learning and practicing CW. No download.
Process audio faster than real‑time with OfflineAudioContext. Apply filters and export the result. Dev tool.
Hear a common bird song and choose the correct species from multiple choices. Ear training for birders.
Play a simple monophonic synthesizer with your keyboard. Choose waveform, attack, decay, and filter. For music fun.
Change the viewport meta tag and see how a page would render at different device widths. Understand responsive basics.
Choose a base color and see its complementary, split‑complementary, triadic, and tetradic harmonies. Copy palettes. Local.
Convert between pace (min/km, min/mile) and speed (km/h, mph). Predict race finish times for 5k, 10k, half and full marathon based on a recent split. Works offline.
Play a collection of retro 8‑bit synth pads and leads using your keyboard. Record sequences and export as WAV. Pure Web Audio API.
Route your microphone input through a chain of virtual effects (distortion, reverb, delay) using Web Audio API.
Select functional groups to see an approximate IR absorption spectrum. Learn spectroscopy visually. All local.