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

Allow site to ask UpUp if offline mode is available #1

Open
TalAter opened this issue Mar 11, 2015 · 3 comments
Open

Allow site to ask UpUp if offline mode is available #1

TalAter opened this issue Mar 11, 2015 · 3 comments
Milestone

Comments

@TalAter
Copy link
Owner

TalAter commented Mar 11, 2015

An idea:

UpUp.isAvailable()
Returns 0 if UpUp requirements aren't supported by current page (e.g. ServiceWorkers, HTTPS, etc.)
Returns 1 if UpUp supported.
Returns 2 if UpUp supported and cache is filled.

@TalAter TalAter changed the title Allow site to ask UpUpUp if offline mode is available Allow site to ask UpUp if offline mode is available Mar 11, 2015
@TalAter TalAter modified the milestones: v0.2.0, v0.3.0 Sep 2, 2015
@yankeeinlondon
Copy link

I'd suggest there be two callable endpoints:

UpUp.isOffline() - boolean flag indicating online/offline status
UpUp.browserSupported() - boolean flag which indicates whether a browser supports SW

Ideally the online/offline information might also be exposed as an event emitter ...

let foo = UpUp.offline;
foo.on('offline', () => {});
foo.on('online', () => {});

This latter functionality might be more easily addressed once the #42 issue is addressed

Finally, no need for an event emitter for browser support as I think this would always be static (outside of a config change like in Firefox 42 but that's too small a edge case to consider a solution for).

@TalAter
Copy link
Owner Author

TalAter commented Jan 1, 2016

I'm thinking a more generic function than browserSupported()... maybe something like supported() which could also test for other compatibility issues (e.g. HTTPS)

@yankeeinlondon
Copy link

I think those messages serve different audiences ... Meaning the HTTPS issues is more of a developer issue whereas the browser support is more of a dynamic client issue. Still I can see that combining them could make sense from an UpUp perspective. If a developer wants to react to client browser they can pretty easily test for it with window.navigator.serviceWorker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants