config.sw should point to uv.sw.js, not the stock sw.js we now use a fixed path in register-sw.js
19 lines
452 B
JavaScript
19 lines
452 B
JavaScript
"use strict";
|
|
/**
|
|
* Distributed with Ultraviolet and compatible with most configurations.
|
|
*/
|
|
const stockSW = "/uv/sw.js";
|
|
|
|
/**
|
|
* Global util
|
|
* Used in 404.html and index.html
|
|
*/
|
|
async function registerSW() {
|
|
if (!navigator.serviceWorker)
|
|
throw new Error("Your browser doesn't support service workers.");
|
|
|
|
// Ultraviolet has a stock `sw.js` script.
|
|
await navigator.serviceWorker.register(stockSW, {
|
|
scope: __uv$config.prefix,
|
|
});
|
|
}
|