ui: safari support

Tested in Safari 8.0 but should work in Safari 6.1 and Mobile Safari 7.1.