fix: sw
This commit is contained in:
parent
0ea1cfc8cc
commit
b432535fea
@ -29,7 +29,7 @@ export default function App({ Component }: AppProps) {
|
|||||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
||||||
<meta name="msapplication-TileColor" content="#da532c" />
|
<meta name="msapplication-TileColor" content="#da532c" />
|
||||||
<meta name="theme-color" content="#141218" />
|
<meta name="theme-color" content="#141218" />
|
||||||
<script src="app.js" />
|
<script src="/app.js" type="module" />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
{`
|
{`
|
||||||
|
@ -1,23 +1,3 @@
|
|||||||
(async function () {
|
if ("serviceWorker" in navigator) {
|
||||||
console.log("Registering service worker...");
|
navigator.serviceWorker.register("/sw.js", { scope: "/" });
|
||||||
if ("serviceWorker" in navigator) {
|
}
|
||||||
try {
|
|
||||||
const registration = await navigator.serviceWorker.register(
|
|
||||||
"sw.js",
|
|
||||||
{
|
|
||||||
scope: window.location.path,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (registration.installing) {
|
|
||||||
console.log("Service worker installing");
|
|
||||||
} else if (registration.waiting) {
|
|
||||||
console.log("Service worker installed");
|
|
||||||
} else if (registration.active) {
|
|
||||||
console.log("Service worker active");
|
|
||||||
}
|
|
||||||
console.log(registration);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`Registration failed with ${error}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "",
|
"name": "",
|
||||||
"short_name": "",
|
"short_name": "",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "/android-chrome-192x192.png",
|
"src": "/android-chrome-192x192.png",
|
||||||
"sizes": "192x192",
|
"sizes": "192x192",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "/android-chrome-256x256.png",
|
"src": "/android-chrome-256x256.png",
|
||||||
"sizes": "256x256",
|
"sizes": "256x256",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"theme_color": "#ffffff",
|
"theme_color": "#ffffff",
|
||||||
"background_color": "#ffffff",
|
"background_color": "#141218",
|
||||||
"display": "standalone"
|
"display": "standalone"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user