I have an app written in js. I want to convert it to a pwa without a service worker . By adding manifest file I can add it from home screen and open it in full screen mode. Does it still using http caching If enabled or it will fetch request from network every time as I don’t have any service worker .
Secondly how can I provided updated change in manifest file to an already installed pwa in ios.
Related
I am trying to build an offline-data persistent web application with Service Workers. I managed to have it working on my laptop Chrome (51) and it loads the cached files and displays an offline message when I simulate being offline via the Chrome DevTools - Network tab.
I uploaded the application to github to make sure it is available with https (https://mguardos.github.io/index.html)
However, when I try to test it with my Android Chrome (Nexus 5 - Android 6.0.1 - Chrome 51), the application loads fine when online, but if I set the plane mode on and reload the page, the browsers is not checking the service worker but displaying the offline message directly
"You are offline.
Your devide is offline.
Try: ...
ERR_INTERNET_DISCONNECTED"
Is there any option that I have to enabled in my Android Chrome for Service workers to work?
Thanks for any tip
PS (edited): Same issue occurs with Opera 37 on Android 6.0.1. However, the Registration service happens properly for both Chrome and Opera in the background (validated via an alert upon the registration method is successfully completed)
PSS: The link above tries to be a very basic example of combining service workers with AppCache, to retrieve localStorage and IndexedDB data so any constructive critic would be very much appreciated on top of the original question
The problem in Chrome seems to be that it requires the entry '/' to be added to the files to be cached for the Service Worker. I added that entry and I could see the application working fine while offline with my Android
However, the problem with Opera remains the same, I can even replicate it with the https://airhorner.com app
Just Open Opera (make sure you clean the cache before)
go to https://airhorner.com (the application loads fine - although it does not sound)
Activate airplane mode
Reload the page (the application still loads because it is reading from local cache)
Close the browser or simply go to a different address
Then go back to https://airhorner.com (The Offline message I added to the original question appears)
I will continue my investigation and will potential create a new question just for the Opera browser, as this question has been answered for Chrome
I am making a chrome app. It is for a kiosk type application. At times the computer will be offline when it starts up. So I'm looking to make an application that a user can navigate to a website and then the entire website is cached. Then when they turn on the Chromebox/Chromebook the website will come up as it was. Including JS/CSS/dynamically loaded content.
Overall I'm looking to save the state of the entire webview and have it keep going after the machine reboots. I looked into saving the JS/CSS/HTML but then the dynamically loaded content (ajax calls) is not available. Is there a higher level function for saving the ENTIRE state of the webview in a google chrome app?
Zebradog's Kiosk Chrome App recently added "Serve local content" support. It works by using Web Server for Chrome in the background. It loads the content in a webview. You may not want a whole kiosk app, but this could at least be a starting point for you to use as reference.
One way of actually getting all the files, if you don't have them already, would be to use wget -r -k
We have built an in-house Enterprise iPad2+ application that connects to a Drupal CMS, where content (text/images/video) is being delivered to the app via a REST API.
When the user launches the app for the first time, they are prompted to download the content over WIFI network. We are experiencing content failing to download inconsistently i.e. sometimes 60 images fail to download; other times 20 images fail. Since we've added video into the download mix, the content is failing even more often.
Server details:
Windows server
IIS7.5
PHP 5.3
MYSQL5.1
App details:
Require.js: provides JavaScript file and module loading
Backbone.js: provides a frontend JavaScript application framework
Cordova (v2.7.0): Used to provide an environment to run on iOS
Raphael.js: For procedural graphics and animations
jQuery and plugins: For Dom manipulation, animations and interactions
Bootstrap: Base framework for HTML mark-up
Download process is as follows:
User launches app and is prompted to download content
Download begins
The app now makes AJAX call to REST API to fetch content
Upon a successful fetch, the REST API delivers an array of content (text/images/video) - max video filesize 11mb
Content is delivered synchronously
We can add logic to keep retrying upon failure, but this could result in an indefinite loop. The content download size is approx. 50mb, over WIFI.
Our testing:
We have tried from 3 different locations in the world: SA, UK and US and similar issues.
We've tested a 300mb download from the same server, on the same iPad and it downloads fine
QUESTION:
Can anyone tell us why this would be failing?
Could the problem be with a Drupal configuration issue we're missing?
UPDATE 25 August:
We have done some more research and it seems the problem may be a result of iOS Safari timing out at 60secs, and then everything fails after that that to download - see here: http://www.sencha.com/forum/showthread.php?111231-iOS-Safari-Mobile-AJAX-timeout
Has anyone else come across this issue?
We have tried downloading over LAN, and that is 100% fine. WIFI is the issue.
We have tried refreshing the download script after x seconds and resetting the timeout counter. We've tried to detect if a download has failed and to continue retrying it.
Stumped at this point...
UPDATED SOLUTION 28 August:
UPDATED SOLUTION: we have fixed the problem. The issue fundamentally lies in the fact that iOS Safari times out at 60secs. Why? We have no idea... What we were doing was fetching the full list files to download, and then downloading them synchronously. What happened at 60secs, is the download times out and we were losing our file list. What we did to resolve this, is we saved the files not downloaded list at 60secs, then started the download process again with this new list, and repeated this process until all files successfully downloaded.
I have a simple web app that I want to use locally (i.e. I don't want it to ever access the network). All the code is packaged according to the Safari Web Content Guide. I was successful in downloading my web app to my iPhone. I noticed, though, that even though my web app doesn't connect to anything remotely, there will be a network access (the network access indicator fires).
I suspect that iOS is checking to see if the web app is fresh (i.e. checking the cache manifest to see if it needs to update any files). Is there a way to prevent this? It really screws up the user experience.
The never-ending network spinner is a bug in iOS; you won't be able to get around it with a web app:
http://www.devthought.com/2012/09/22/understanding-the-ios6-ajax-bugs/
I'm developing a small HTML5 web application for iPad that is intended to work in fullscreen mode (ie. it has the proprietary Apple meta tag, it is added to Home Screen):
<meta name="apple-mobile-web-app-capable" content="yes" />
The application basically fetches some data via AJAX and presents it to the user. The AJAX data are external (from a different domain, different server). I have the system setup for cross-origin requests, they work in online mode. In other words: the static data lie on server A, the dynamic data - on server B.
I created a proper cache manifest file, listing all static content of the site (HTML, CSS, images, JS) and then having the NETWORK: * section at the end - this way all the dynamic content (AJAX) is always retrieved from the network. The application fails "gracefully" if the requests fail, by displaying some fake content.
With the above setup, the following happens:
If I run the application while online, everything works ;)
If I disable the WiFi on iPad (pure offline mode), everything works as expected - the application falls back to the offline content
If I connect to the network again, but take the static-content server offline (the one that has everything cached), the application won't start; after spending a while in splash-screen, it shows me the a popup with <app> could not be opened because it could not connect to the server.; I can either choose Close or Retry.
The point 3 of the above is the one that drives me crazy because it was the only reason I started fiddling with application cache. Why doesn't the iPad web app fall back to cached content if the manifest file is not reachable? (not 404, the server is offline)
Is the answer to HTML5 iphone offline webapp completely incorrect? If not, how can I achieve this behavior on iPad?
Point 2 and 3 are completely different scenarios, so we cannot expect the same behavior.
In point 3, the device cannot fall back to the cached content when in online mode because if it do so, there will be no way to know for the user whether he is connected to the server or not.
I mean, in offline mode, the user knows it, and knows that he is with cached data. But in online mode, he expects to get the stuff from the server. If the server is not available, the user should be aware of this. If the server is not available and he is sent directly to cached data, the server error will be hidden to him, thinking that he is connected when he is actually not.
For example, web browsers can cache pages to be seen in offline mode. But if we are in online mode and try to open an unavailable page, we expect to see the error message, not a cached version of the page without any warning. We can go to offline mode to see the cached page if we want, but the correct behavior is to show the error to the user.