Question

As part of a loading screen for an offline-enabled web application I'm building (using a cache manifest), I have run into browser compatibility issues.

In the latest versions of Chrome, FireFox, and Safari, I am able to download the files in my cache manifest and go offline, but in iOS 4 Mobile Safari, the window.applicationCache.error event is raised. The event argument I receive back is completely empty. Additionally, I have enabled the debug console on my iPad, but there is no relevant error information.

Does anyone know if there is a way to extract error information from the offline-caching error event?

Was it helpful?

Solution

I had a unique problem, in that I was serving up my offline manifest via an ASP.NET generic handler (.ashx), and Safari flat-out refused to open the file. I'm not sure if .ashx's are some type of protected file extension in Safari, but it was a difficult to diagnose error.

I ultimately found the error by checking to see if Safari was even hitting the offline manifest, something you may have to check with server logs.

OTHER TIPS

If mobile Safari permanently will run into an caching error but Safari on PC or Mac will do caching, it might be that you have cleared the browser cache without closing all browser screens and closing the browser also. Clearing the browser cache removes also the applicaton caches, especially the cache database. As long as there is a browser screen opened, mobile safari does not recreate the application cache database. As a result of this each application caching operation will fail, due to missing database. PC-Safari never destroys the database file but deletes the entries in the database.

As I know, there is no way to detect this situation via JavaScript.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top