It looks like offline app is supported on most browsers. I copied the example app from WHATWG and put it on an web server but it didn't work when I test with the steps below:
- browse to clock.html with windows phone 8.1 (IE 11)
- page looks fine, then exit the browser
- disable wifi and cell data
- browse to the clock.html again but get
Cannot find server or DNS error
I was not browsing in private mode and did not clear any browser cache. I don't know if this is specific to windows phone yet, but will test with other devices later.
clock.appcache
CACHE MANIFEST
CACHE:
clock.html
clock.css
clock.js
clock.html
<!DOCTYPE html>
<html manifest="clock.appcache">
<head>
<title>Clock</title>
<script src="clock.js"></script>
<link rel="stylesheet" href="clock.css">
</head>
<body onload="updateIndicator()" ononline="updateIndicator()" onoffline="updateIndicator()">
<div>The network is: <span id="indicator">(state unknown)</span></div>
<div>The time is: <span id="clock"></span></div>
</body>
</html>
clock.css
.clock { font: 2em sans-serif; }
clock.js
setInterval(function () {
document.getElementById('clock').innerHTML = new Date();
}, 1000);
function updateIndicator() {
document.getElementById('indicator').innerHTML = navigator.onLine ? 'online' : 'offline';
}