Skip to content

Commit 14d8c01

Browse files
committed
Update index.html
1 parent 8ee7e2e commit 14d8c01

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

index.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@
3737
<script>if (top !== window) { window.location.href = '/redirect' }</script>
3838
<script>
3939

40-
if (localStorage.getItem('installed')) {
40+
try {
4141

42-
if ((new URL(window.location.href).search) !== '?p') {
42+
if (localStorage.getItem('installed')) {
4343

44-
window.location.replace(window.location.origin + '/full');
44+
if ((new URL(window.location.href).search) !== '?p') {
45+
46+
window.location.replace(window.location.origin + '/full');
47+
48+
}
4549

4650
}
4751

48-
}
52+
} catch(e) { }
4953

5054
</script>
5155
<script defer data-domain="codeit.codes" src="https://plausible.io/js/plausible.js"></script>
@@ -306,8 +310,12 @@ <h2 class="color-1 weight-title-h font-title section__title center">A codeful of
306310
}
307311

308312

309-
// register service worker
310-
navigator.serviceWorker.register('/service-worker.js');
313+
try {
314+
315+
// register service worker
316+
navigator.serviceWorker.register('/service-worker.js');
317+
318+
} catch(e) { }
311319

312320

313321
// add scroll event listeners

0 commit comments

Comments
 (0)