Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workbox #162

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion _layouts/blank.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
{% include svg-icons.html %}
<script>
if ('serviceWorker' in navigator) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are making changes, can me add a friendly console warning message if service workers are not supported?

Something like:

if ('serviceWorker' in navigator) {
  // ...
} else {
  console.warn('Service workers are not supported by this browser. :(');
}

navigator.serviceWorker.register('/sw.js');
navigator.serviceWorker.register('/sw.js').catch(e => console.error("Problem installing service worker:", e));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Single quote for consistency? :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

} else {
console.log('Your browser does not support service workers :(')
}
</script>
</body>
Expand Down
23 changes: 0 additions & 23 deletions js/vendor/sw-cacheable-response.min.js

This file was deleted.

Loading