UNPKG

@thepassle/app-tools

Version:

Collection of tools I regularly use to build apps. Maybe they're useful to somebody else. Maybe not. Most of these are thin wrappers around native API's, like the native `<dialog>` element, `fetch` API, and `URLPattern`.

15 lines 357 B
/** * @type {import('../index.js').Plugin} */ export const checkServiceWorkerUpdate = { name: 'checkServiceWorkerUpdate', beforeNavigation: () => { if ('serviceWorker' in navigator) { navigator.serviceWorker.getRegistration().then(registration => { if (registration) { registration.update(); } }); } } }