Skip to content

Instantly share code, notes, and snippets.

@JamesKyburz
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save JamesKyburz/37d4a31a243cfd093603 to your computer and use it in GitHub Desktop.

Select an option

Save JamesKyburz/37d4a31a243cfd093603 to your computer and use it in GitHub Desktop.
iOS8-issues

iOS8 issues I have come across

For a more complete list check out apple shows love for html5

Debug

  • No inspector when using mobile safari and pluged in iOS device.
  • Inspector works for home screen apps.

Look and feel

  • window.scrollTo(0, 1); doesn't hide the url bar anymore.
  • Landscape causes the status bar to sometimes disappear (iPhone 5). Don't know if feature or bug.
  • fixed and absolute dom elements. This has from day 1 been broken. Now it's broken in new ways...
  • On iPad2 the cellular + battery status bar is sometimes black and sometimes white.

Misc

WKWebView cannot load files using file:// URL protocol since iOS 8 beta 4 and 5

Homescreen

  • html5 video doesn't work at all, for example using youtube's embed iframe it never plays. (still broken in IOS 8.1.1)
  • window.indexedDB is there, set to null and is a READONLY property. Breaking shims/feature detection. (https://github.com/JamesKyburz/IndexedDBShim/commit/a254fdddb4880af4afee79f8984574eda7b09d09) fixes this if used in combo with idb-wrapper.
  • calling prompt/alert in the same tick in the event loop for (click/touch) causes safari to crash with EXC_CRASH (SIGABRT) The fix for this is not ideal because calling prompt in setTimeout doesn't show the keyboard.....
  • locking and unlocking device removes all javascript timers! event listeners are intact, however even a location.reload() doesn't fix this issue. You are left with a mobile safari in an unusable state! My fix was to abuse the other alert bug, you will need your own implementation of ping.
    //iOS8 deletes all timers and leaves mobile safari in an unusable state.
    if (window.navigator.standalone) {
      document.addEventListener('touchmove', heartBeat, false);
      ping();
    }
    
    function ping() {
      // when timers are removed session.get will never call the callback
      setTimeout(session.get.bind(session, 'ping', ping), 1000);
      ping.i = new Date();
    }
    
    function heartBeat() {
      if (new Date() - ping.i > 4000) {
        // this will crash mobile safari because of another bug, this it what we want in this case though ;)
        alert('Some helpful text, blah blah');
      }
    }
    
@ulken
Copy link

ulken commented Sep 19, 2014

@JamesKyburz
Copy link
Author

@ulken thx for the update

@romanov
Copy link

romanov commented Sep 23, 2014

@JamesKyburz, "window.indexedDB is there, set to null and is a READONLY property"
Is it a bug and they will fix it?

@PastestLtd
Copy link

Are you aware of the issue with videos in web apps saved to the home screen? They play fine if the web app is run within Safari, but won't play if run from the home screen icon.

@JamesKyburz
Copy link
Author

@getnorthern Yepp still not working on iOS 8.1.1 :( Added it to the gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment