This commit is contained in:
max_richter 2023-08-10 11:44:14 +02:00
parent 0ea1cfc8cc
commit b432535fea
3 changed files with 21 additions and 41 deletions

View File

@ -29,7 +29,7 @@ export default function App({ Component }: AppProps) {
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#141218" />
<script src="app.js" />
<script src="/app.js" type="module" />
<style>
{`

View File

@ -1,23 +1,3 @@
(async function () {
console.log("Registering service worker...");
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}`);
}
}
})();
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/sw.js", { scope: "/" });
}

View File

@ -14,6 +14,6 @@
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"background_color": "#141218",
"display": "standalone"
}