Skip to content

Commit

Permalink
Restore PWA installability.
Browse files Browse the repository at this point in the history
- Remove `sw.js`, too lazy to debug it. Nora doesn't care if PWA assets are
  cached.
  • Loading branch information
MichaelDiBernardo committed Aug 29, 2024
1 parent 85b927a commit ef60e61
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 91 deletions.
8 changes: 0 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@
<link rel="stylesheet" href="style.css" />

<!-- Javscript -->
<script>
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker &&
navigator.serviceWorker.register("./sw.js");
});
}
</script>
<script defer src="./main.js"></script>
</head>

Expand Down
4 changes: 4 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ function choose(array) {
* computers failing for no discernible reason.
*/
async function initializeGame() {
// Preload the CSS background texture.
await getImage("forest-tile-512x512.jpg");

// Preload all the "game assets."
rockSounds = await Promise.all(rockSoundsFiles.map(getSound));
rockImages = await Promise.all(rockImagesFiles.map(getImage));
bugClickSounds = await Promise.all(bugClickSoundsFiles.map(getSound));
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Nora Looks For Bugs",
"short_name": "Nora Looks For Bugs",
"short_name": "NoraBugs",
"display": "standalone",
"start_url": "./?utm_source=pwa_install",
"scope": ".",
Expand Down
82 changes: 0 additions & 82 deletions sw.js

This file was deleted.

0 comments on commit ef60e61

Please # to comment.