UpUp is not working on Firefox 44 / Linux 64-bit
ovidiugabriel opened this issue · 7 comments
This is the example I used and it is copied from https://www.talater.com/upup/
<script type="text/javascript" src="/js/upup.sw.js"></script>
<script type="text/javascript" src="/js/upup.min.js"></script>
<script type="text/javascript">
if (navigator.serviceWorker) {
if (UpUp !== null) {
UpUp.start({
'content': '<html><body><h1>Top Hotels in Rome</h1><p>Villa Domus</p><p>Hotel Trivelli</p></body></html>'
});
console.info('UpUp initialized');
} else {
console.warn('UpUp is null');
}
} else {
console.warn('serviceWorker is not available');
}
</script>
The page is white, even if I choose "File > Work Offline" and I refresh the page.
Is there a live page showing the problem I can look at?
You seem to missing upup.sw.min.js, so the service worker is not getting installed. It seems we are not rejecting the register() promise in this case, though.
Oh, we are rejecting, but it seems you have logging disabled in upup. The console.log() message that would have told you this is disabled. From the minified source:
e=!1
e&&console.log("ServiceWorker registration failed: %c"+a,f)
Thanks @wanderview.
@ovidiugabriel I'm also not seeing the upup.sw.min.js file on your server.
You should also probably place it in the root directory, and not in the js directory.
Hey, Thanks a lot for you very fast answers.
Ok. I have to be more specific on this issue.
I moved upup.min.js into the root folder and also copied upup.sw.min.js into the root folder.
It works now, thanks!
I notice some things though:
- UpUp Offline mode works only when Firefox in "Offline mode" and the cache is cleared. So, as long as the browser cache is available, UpUp offline mode won't be triggered even if the browser is in offline mode.
- If I am in firefox offline mode and I hit Ctrl+Shift+R (complete refresh), I receive "Firefox is currently in offline mode and can't browse the Web." and UpUp is not able to work in this mode. However, if I hit F5 or Ctrl+R (simple refresh), UpUp offline mode is working again.
Ok, this is not a real issue, but it is just a summary of usecases that can happen while using UpUp.
Great job, folks! Thanks!
The service worker (and upup) cannot detect offline status if http cache is still serving content.
A hard refresh (ctrl-shift-r) must bypass the service worker per the spec.
@wanderview : Exactly. Important to know this info. Thanks!