Search code examples
iosmobile-safarihtml5-appcache

Why are history entries not entered in mobile safari when using the application cache?


When using the application cache in mobile safari, history entries are not created when the hash fragment is changed. Why is this?

For instance, try the following.

index.html

<!doctype html>
<html manifest='test.manifest'>
  <h1>test</h1>
</html>

test.manifest

CACHE MANIFEST
# version: 1

NETWORK:
*
  1. Visit the site.
  2. Change the hash fragment.
  3. Press the back button.

I expect to be returned to the original hash, but am not. Instead the back button is either disabled or skips the first history entry.


Solution

  • This is a bug in Safari 7. Only known work around is disabling appcache.

    See history.back() doesn't work in Safari on iOS