-
Notifications
You must be signed in to change notification settings - Fork 29
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
app-indexedb-mirror not working on android #49
Comments
It might have something to do with this using the wrong BASE_URI https://github.com/PolymerElements/app-storage/blob/master/app-indexeddb-mirror/common-worker.html#L23 |
I think this is indeed a bug in https://github.com/PolymerElements/app-storage/blob/master/app-indexeddb-mirror/common-worker.html#L23 I added a rewrite rule to my firebase.json and it seems to have worked around this issue in my app
still not sure if this fixes offline support |
Nope, didn't fix offline, it just gets stuck on that request I added some things to my sw-prechache config
now it gets past that request and actually loads data from indexeddb when offline so that's a big improvement; only after a long delay though |
I also hacked in this to common-worker.html
|
This didn't work
but THIS did
Still no offline joy, until I think I found the last piece of the offline puzzle; common-worker does this thing where it passes the url to the real worker as a URL argument with ? and that confuses the service worker and bypasses the pre-cache Found the fix here https://github.com/GoogleChrome/sw-precache#ignoreurlparametersmatching-arrayregex put
into sw-precache-config.js |
@abdonrd Looks related to Polymer/polymer-build#22 I also opened PolymerElements/app-storage#78 |
I was trying to get the app to work offline on my phone without much luck; I fired up chrome remote debugging and sure enough there is an error on the js console
if we flip over to the network pane and look at the offending request I note that although a .js file was requested, the server has responded with text/html content; indeed on the preview pane I see that it is index.html
You can actually test this from the command line using this curl command; you should get JS but you get HTML
I hypothosise this is caused by firebase hosting rewriting the URL to index.html. maybe because of the rewrite rules in firebase.json
alternatively maybe the service worker config needs to treat this request differently?
need to figure out how to get firebase to NOT rewrite that URl
The text was updated successfully, but these errors were encountered: