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

Offline support in Firefox #43

Closed
sejoker opened this issue May 26, 2016 · 11 comments
Closed

Offline support in Firefox #43

sejoker opened this issue May 26, 2016 · 11 comments
Assignees

Comments

@sejoker
Copy link

sejoker commented May 26, 2016

I was impressed with the demo @addyosmani did at IO 2016. Offline support works perfectly in Chrome. I cannot get it working in latest FF 46, although according to Jake Archibald's status page the service workers support in FF as good as in Chrome. Maybe the libraries that were used (sw-toolkit and sw-precache) have some issues or it is the lack of testing in FF?

I noticed that both offline features don't work:

  • refreshing the home page in offline mode
  • opening the cached comments page.
@addyosmani
Copy link
Collaborator

Just to check: for offline cached comments did you turn on 'Offline Mode' in Settings before testing? Also, were you testing on Firefox for Android or Firefox desktop?

@addyosmani addyosmani self-assigned this May 27, 2016
@sejoker
Copy link
Author

sejoker commented May 28, 2016

@addyosmani you are right, I forgot to check 'Offline mode' in Settings when tested in the desktop version of FF, it works perfectly fine in Firefox desktop.

On a side note, I've tested the app on the mobile (Nexus 6, Android 6.0.1) and cannot make it work in offline mode using FF and Chrome ('Offline mode' checked in Settings).

I assume this issue could be closed, but I would be appreciated to know how to make it work on mobile as well.

@addyosmani
Copy link
Collaborator

@sejoker I need to come up with a slightly better UX for it, but something that you might find fixes issues you're running into on Android is pulling-to-refresh once you've switched to Offline Mode or relaunching the app from your homescreen after going into Offline Mode. That should trigger it. I probably could add a 'force refresh on setting the option' routine in there to avoid this. Will consider it :)

Closing this issue, but if you run into any trouble feel free to keep pining this thread and I'll file bugs if there's anything unknown you run across.

@sejoker
Copy link
Author

sejoker commented May 28, 2016

At least comments cache in 'Offline mode' doesn't work on Android mobile (on both Chrome and FF). Tried to run from homescreen and in the browsers. Also, the issue reproduced on Android 5 (tried on the different device to be 100% sure).

@addyosmani
Copy link
Collaborator

@sejoker I'll try to reproduce this on a few different devices and get back to you. My current testing steps are as follows:

  • Add the normal app to the homescreen
  • Launch app from homescreen
  • Turn on 'Offline mode' from Settings
  • Refresh the page or pull down to refresh.
  • Navigate to a page where you want comments to be cached
  • Close the app
  • Turn on Airplane mode
  • Launch the app. Navigate to the page commented were supposed to be cached

If you're following similar steps and running into issues, that's definitely a bug and I'll chase down the cause.

@sejoker
Copy link
Author

sejoker commented May 30, 2016

@addyosmani you have precisely described the steps I used to reproduce the issue.

@addyosmani
Copy link
Collaborator

Hmm. Just tested the above on Firefox for Android (Beta) and story and comment caching was working as expected. Perhaps I'm using different versions of these browsers. Could you confirm what versions you're using and I'll give those a spin too? :)

@sejoker
Copy link
Author

sejoker commented May 30, 2016

I finally figured out the reason why it didn't work for me. Service workers require https only, the website allows to work with http and doesn't redirect to https by default. Initially, I've added the link to the homescreen when served the page from http. I confirm that caching works on Firefox and Chrome on Android when accessed through https.

@sejoker
Copy link
Author

sejoker commented May 30, 2016

@addyosmani thanks a lot for your time.

@insin
Copy link
Owner

insin commented May 31, 2016

Looks like this is the necessary app.yaml config to require https and redirect to it from http: https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml#security

@addyosmani
Copy link
Collaborator

I'll create a new issue to update the app.yaml. Thanks @insin!

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

No branches or pull requests

3 participants