7 ms·
Safari on iOS 4.2: Accelerometer, WebSockets, SVG, AJAX2 & better HTML5 support
- ugh 16y agoApple clearly hates the web!
- sandipc 16y agohas this actually been a criticism of Apple in the past? the major contributor to webkit?
- tedkimble 16y agoYes. But if you look hard enough you can likely find a criticism for everything.
- netghost 16y agoHah! I haven't found anyone criticizing your comment yet. ...oh drat!
- sudont 16y agoActually, a sizable portion of HN thinks that Apple will start to take after Microsoft in the 90's in regards to the web. (They also seem to think Google made WebKit's inspector pane.) A big complaint is about the -webkit prefix, despite the fact that A List Apart and Zeldman champion it as reducing the amount of browser hacks needed due to the inconsistencies in rendering. (Think how wonderful an -ie6 prefix would be. Now, think about a CSS parser that doesn't fail in specific ways allowing the dev to target it. border-top-left-radius can't be targeted to a specific render, but screws up in different browsers, so it has to be rendered through JS or conditional stylesheets.) I can't find the actual topical discussion in google, so here's one that links to a news article about the quote in relation to Facebook: http://news.ycombinator.com/item?id=1929796 http://news.ycombinator.com/item?id=1929796
- tvon 16y agoI thought the argument was that the App Store encouraged per-website apps instead of just using "The Web"...?
- kenjackson 16y agoBoth arguments are made. Although frankly I think with Android and WP7 presenting credible threats to Apple, they aren't in a position to dictate. With this amount of competition, MS, Google, and Apple all have to fight on all fronts. Only until one has a monopoly like position will we know their true motivations... I prefer not to know any of their motivations. :-)
- andreyf 16y agoI think Jobs has been repeatedly clear that iOS supports two platforms: the web, an industry standard Apple tries hard to advance to the best of its ability, and iOS, which Apple keeps proprietary and advances to the best of their ability that way. Apple is devoting significant resources to developing both (in leu of focusing 100% of engineering on either), as an experiment, if you will. Now, if only web apps on iOS could enter into full-screen mode like native apps...
- cubicle67 16y agoNow, if only web apps on iOS could enter into full-screen mode like native apps... They can. You need to add some additional metadata to the header, and the user needs to save that url to their homescreens (homescreens? does that even make sense?), but once done the web app looks like a native one. You can even define a splash screen to display while the page loads. Edit: here's the line you need (from http://raphaelcaixeta.com/blog/2010/08/13/meta-tags-to-help-your-ios-web-app-look-like-a-native-app/ http://raphaelcaixeta.com/blog/2010/08/13/meta-tags-to-help-...) <meta name="apple-mobile-web-app-capable" content="yes" />
- alanh 16y agoExcellent, yes. This is what Glyphboard does. Thanks for pasting the code & a link.
- igorgue 16y agoWe hate the web... we asked for a SDK when the iPhone was released ;-)
- swannodette 16y agoTyped array feature is pretty interesting.
- jws 16y agoMozilla has a selector, mozResponseArrayBuffer, to get an AJAX result as an ArrayBuffer. Having worked with binary data from an AJAX query I whole heartedly applaud! I hope Webkit has a mechanism for that, and even more so, that the W3C writes a standard for it.
- swannodette 16y agoNice. On a different note, WebKit sure is dragging its feet about adapting Object.freeze. Please, for the love of JavaScript, give us immutable objects.
- othermaciej 16y agoWe're slowly adding more ES5 features to JavaScriptCore. While Object.freeze is not in yet, we do have Object.defineProperty, which you can use to make individual properties read-only and non-deletable. Once Object.preventExtensions is added, freeze and seal should be trivial.
- paulitex 16y ago"Learn Objective-C" just fell about 5 spots in my to-do list.
- kenjackson 16y agoI'd love for John Carmack to spend 18 months heads-down doing an HTML5 engine. Even if he failed to do anything incredible, the feedback would be invaluable.
- chunkbot 16y agoI love the fact that with mobile devices, we all get to witness Mr. Carmack doing what he does best for a second time: pushing resource-constrained devices to their limit.
- drawkbox 16y agoNo hardware acceleration on the browser just yet and still scripted canvas so that is slower. So until WebGL, even then, OpenGL ES will still be needed for most games/interactives/apps until we hit 2GHz and about 1GB of RAM or higher. Then things like Flash also start to perform reasonably enough, same with html5 animation. If they were hardware rendered now then they would be reasonable but still wouldn't be compared to compiled, native apps on the device. Just like desktop now only the current mobile hardware is the desktop hardware of the late 90's. WebSocket support, canvas, svg etc is awesome for games though.
- bad_user 16y agoYeah, but can you upload pictures from iOS Safari?
- spullara 16y agoNope. Still inferior to Android 2.2 on this front. Pretty annoying.
- BenjieGillam 16y agoNot really "accelerometer" support, just orientation. You couldn't really build a motion sensing engine with it. WebSockets should be really cool on mobile though...
- tlrobinson 16y agoPretty sure you can get 3-axis accelerometer data, at least according to this snippet: window.ondevicemotion = function(event) { // event.accelerationIncludingGravity.x // event.accelerationIncludingGravity.y // event.accelerationIncludingGravity.z }
- othermaciej 16y agoI hate to find fault in an otherwise informative and complimentary post, but what the heck is AJAX2? XMLHttpRequest Level 2 is a revision of XMLHttpRequest, not of "AJAX", which is a fuzzy bundle of concepts referencing a style of Web application development. It has no 2.
- chrisbroadfoot 16y agoI was interested in the "accelerationIncludingGravity" property. It seems needlessly verbose. I thought - why isn't there just isn't a separate "gravity" property to complement the "acceleration" property? After a bit of digging around I found this: http://lists.w3.org/Archives/Public/public-geolocation/2010Aug/0015.html http://lists.w3.org/Archives/Public/public-geolocation/2010A... > We can't use > acceleration & gravity in place of acceleration & > accelerationIncludingGravity as some devices are unable to determine > the acceleration without the effects of gravity - that's the > motivation for the property.
- steilpass 16y agoSo why isn't Android innovating in this space?
- Raphael 16y agoGood question. Opera Mobile for Android just came out and has some interesting features (tabs, bookmark sync) and SVG support, which is oddly lacking in the stock Android browser. Firefox mobile is in beta as well, with roughly equal features as Opera, plus extension support. I'd like to see the default browser get more frequent updates, though.
- ergo98 16y agoNot sure why Android gets pulled into this, however in addition to the fact that Android 2.2 has far and away class leading canvas and JavaScript performance -- the poor performance on iOS is why so many apps go native on that platform for trivial needs -- and brings virtually all of the Google Gears functionality that became the foundation of "HTML5" to Android (web databases, web workers, geolocation), the next version of Android is going to feature optional javascript access to the camera, among other improvements. Android is innovating heavily, and your comment is way off base.
- steilpass 16y agoApple updated their documentation: http://developer.apple.com/library/safari/navigation/index.html http://developer.apple.com/library/safari/navigation/index.h...