Closed auser closed 9 years ago
Hi there,
sw.js
is a file you write and include in the www/
directory of your app. This plugin provides implementations of typical APIs you'll use in your sw.js
file, like fetch
and cache
.
The README will soon include a lot more detail. If you're unfamiliar with ServiceWorkers, check this out; if you're already familiar, then most principles apply here; once you've installed this plugin, your existing sw.js
file should work for your iOS app.
Please let us know if you have more questions. Thanks!
Actually, I do have a q you may be able to answer quicker than I can discover it.
I'm loading my index.html
remotely (i.e. http://[ip]:8080/index.html. With this plugin installed, looks like
fetch` is being called on it and adding it to a load queue, which obviously disrupts loading the main file. Is there a way to dis-clude a file from being queued for remote fetch?
When you say that it disrupts loading, do you mean that it slows down the load, or that the load fails completely?
The load fails completely
I'll definitely check that out, thanks. Do you have a service worker script installed at all?
Nope, not yet.
Can you try adding a sw.js file beside your index.html (in your www/ folder) --even an empty one should allow the plugin to initialize, and then it will be able to process the queue, and your page should load.
It looks like we're not handling that case gracefully at all. I'm filing a bug for that right now.
Filed #8
Where is
sw.js
located? Looks like it's not included in the repo...