-
Notifications
You must be signed in to change notification settings - Fork 345
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
WIP: Dev service worker #1417
WIP: Dev service worker #1417
Conversation
How to test(with a iPhone and Mac):1. Install Charles SSL-CertifacateUsing Official Manual to install ssl-certifacates 2. Build the sw.js from source code.3. Configure
|
The final result. RPReplay_Final1614913156.2.MP4 |
How to test, The Basic Concept. 1 Your need Proxy |
Feel free to re-open this PR if you decide to resume this effort |
Fixes #
Proposed Changes
TODOs
[] In my test, I found out some apis are not cached in the first run. So when I turn my phone to Airplane mode, I navigate to some route, there is no data at all. Maybe There should be one clear list of resources to cache.
[] Cannot offline view a game. It seems the request to sgf is not cached. I shall dig into it.
How to test, The Basic Concept.
1 Your need Proxy
https://online-go.com/sw.js
to your local build distsw.js
. This requires hijack to https, because it service work requires https to work. And the service works js file must using the same domain with the main site.2 You need access to your device's browser console to execute code to register service worker.
navigator.serviceWorker.register('./sw.js')
. We need this code to register service work js file.3 Above 2 steps must be done in the same device, In the test case it's my iPhone.