statki/public/assets/js/worker-handler.js
MaciejkaG a212161733 Major changes
- Improved PWA support on mobile.
- Added Vs. AI game menu.
- Added the first AI algorithm.
- Vs. AI is now available with every option leading to simple bot
- Fixed a bug where placing ships in certain rotation around the boundaries of the board would wrongly colour them when sunk.
- Improved code clarity and comments
- Added an option in the settings to change your nickname
- Added version display in the settings
- Slightly improved box scaling and layout
- Made multiple improvements to the PWA support
- Added multiple minor features
- Brought back full SPA URL functionality, now if you copy a URL to specific view/page in the menu and go into it, you will actually arrive at that page if it's not restricted.
2024-04-14 19:17:20 +02:00

8 lines
320 B
JavaScript

if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker
.register("/assets/js/service-worker.js")
.then(res => console.log("Service worker registered"))
.catch(err => console.log("Service worker not registered", err));
});
}