RESOLVED INVALID 34038
XMLHttpRequest doesn't work when page is loaded from HTML5 offline cache
https://bugs.webkit.org/show_bug.cgi?id=34038
Summary XMLHttpRequest doesn't work when page is loaded from HTML5 offline cache
Tibor Pino
Reported 2010-01-23 06:43:40 PST
I have web app which uses HTML5 offline application caching and offline database. I use XMLHttpRequest to sync date between online and offline databases. Every time I try to call xhr.send(null) (see code below) from my app it ends up with error NETWORK_ERR: XMLHttpRequest Exception 101: A network error occured in synchronous requests. More details about my app. I have 3 files typo.html, javascript.js and manifest file typo.html looks like <!doctype html> <html lang="en" manifest="manifest.manifest"> <head> <meta charset="utf-8" /> <title>offline app</title> </head> <body> <script type='text/javascript' src='javascript.js'> </script> </body> </html> javascript.js looks like var xhr = new XMLHttpRequest() xhr.open("GET","/sync/blog.json",false) xhr.send(null) manifest looks like CACHE MANIFEST #version 6.15 typo.html javascript.js My code is working properly when I try to use app without offline application caching. I thing there should be a property to call ajax from offline cached apps - for instance for syncing purposes.
Attachments
Alexey Proskuryakov
Comment 1 2010-01-23 12:19:22 PST
Сached applications can only access URLs that are whitelisted in NETWORK section of the manifest: <http://www.whatwg.org/specs/web-apps/current-work/#changesToNetworkingModel>. This example should work if you add /sync/blog.json to NETWORK section of the manifest.
Note You need to log in before you can comment on or make changes to this bug.