Reopening PR #87, which was closed in the big dist refactor.
Fixes #6
To test it, edit index.html and set useServiceWorker = true. Then, use the Application tab in Chrome to see the service worker register. You can then check the "Offline" button and refresh to see it working offline.
Note that as of right now, the master branch isn't very useful offline, but if you include my fix for #80, users could go to iplayif.com, click the browser's "install" button to install it locally, and use that to play locally downloaded games offline.
Also note that we're dropping serviceworker.js in the same directory as the index.html file, aka the root directory, because otherwise it doesn't work.
Rewrite my service worker code from scratch, fixing bugs as you go (and feel free to ask me anything you like). It's only a few dozen lines, but there are a lot of weird failure cases (which you'll encounter while working on the Udacity course); by the time you could write this PR yourself, you'll be ready to merge it.
Reopening PR #87, which was closed in the big
dist
refactor.Fixes #6
To test it, edit
index.html
and setuseServiceWorker = true
. Then, use the Application tab in Chrome to see the service worker register. You can then check the "Offline" button and refresh to see it working offline.Note that as of right now, the
master
branch isn't very useful offline, but if you include my fix for #80, users could go to iplayif.com, click the browser's "install" button to install it locally, and use that to play locally downloaded games offline.Also note that we're dropping
serviceworker.js
in the same directory as theindex.html
file, aka the root directory, because otherwise it doesn't work.To learn about service workers: