Skip to content

Commit a29e0f7

Browse files
committed
Test
Signed-off-by: Someshdiwan <[email protected]>
1 parent 83ddacf commit a29e0f7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

site/_layouts/default.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@
6262
{{ content }}
6363
</div>
6464
</div>
65+
<script>
66+
if ("serviceWorker" in navigator) {
67+
navigator.serviceWorker.register("/Java-Mastery/assets/sw.js")
68+
.then(() => console.log("✅ Service Worker Registered"))
69+
.catch(err => console.error("SW registration failed", err));
70+
}
71+
</script>
6572
</div>
6673
</body>
67-
</html>
74+
</html>

site/assets/sw.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
self.addEventListener("install", function (e) {
2+
console.log("Service Worker Installed");
3+
});
4+
5+
self.addEventListener("fetch", function (e) {
6+
// Just let requests pass through for now
7+
});

0 commit comments

Comments
 (0)