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

Check online status before prefetching URLs #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Check online status before prefetching URLs #74

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented May 23, 2020

Related to issue #73

As a website owner, I want to only prefetch URLs when I am online, so that I am not getting network errors when my site is offline or served by a service-worker.

Changes:

Only tested on my setup manually. No test suite was run. Should be tested on larger scope before merging.

Related to issue #73

As a website owner, I want to only prefetch URLs when I am online, so that I am not getting network errors when my site is offline or served by a service-worker.

Changes:

- Implement isOnline function to check online status via navigator.onLine (https://developer.mozilla.org/de/docs/Web/API/NavigatorOnLine/onLine).
- Implement guard in preload function to check online status with this function.

Only tested on my setup. Has to be tested on larger scope before merging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant