'; throw new Error('pair-return: handled, not booting'); // stop the rest of boot } // Register the service worker (installability + offline) — but ONLY on an // http(s) origin. Under Lantern's lantern:// custom scheme (the desktop // shell) and file://, service workers are unavailable/unwanted; gating on // the http(s) protocol leaves the desktop build untouched. Same // progressive-enhancement spirit as the LANTERN-BRIDGE feature-detect below. if ('serviceWorker' in navigator && location.protocol.startsWith('http')) { window.addEventListener('load', function () { navigator.serviceWorker.register('sw.js').catch(function (e) { console.warn('[slate] service worker registration failed:', e); }); }); }