Click here to get a complete list of blogentries.
Safari 5, Flash And The Backspace Key ... Or How Apple Bans Flash from Safari
We have been frantically working on our Flash - based MMO for quite some time now at Rough Sea. We are pretty much getting close to the finish line. Well, the game has a login login form that is completely embedded within the Flash app. No big deal, huh?
The Problem
Today, I got a pretty interesting bug report from quality assurance:
If you open our game in the Windows - version of Apple`s brand-new shining Safari 5 and try to type something in a text-input field (like the login form) and then hit the backspace key (because you may have mistyped something), the browser suddenly goes back in the page history to whatever page you were before.
I tried this with other Flash applications on the net: Same thing!
Solutions?
I tried to solve the problem by capturing the backspace key event using Javascript. Works great until the Flash app gets the focus. Bummer ! The event onBeforeUnload isn`t an option either because it`d be painfully annoying for the user to get a confirmation popup each time he/she made a typo.
Over at "MacOS X hints" there is an artical about how to change the keyboard shortcuts in Safari. It's a bit brute force but it should solve the problem.
The Cause
The root of the problem is that the browser carries out keyboard shortcuts regardless of the flash app having the focus or not. As soon as the flash app gets the focus the programmer completely looses control over the browser`s key event behavior.
Thoughts
To sum it up: Apple made it virtually impossible to work with any Flash - based web app that features text input or even *gasp* uses the backspace for some other user interaction. While this is clearly a bug, it kind of makes you wonder if Apple is deliberately trying to sabotage Flash, since this problem does not occur with Java applets or HTML - Forms. Well, this would certainly fit into Apple`s rampage against Adobe in the past weeks. BTW same thing happens with Silverlight according to a post in the Apple support forum.
IMHO, considering the market share of Safari, it wouldn`t make much sense, though. They would force most of the Safari users to migrate to another browser if they want to use Flash, possibly reducing the small number of users even more. [UPDATE 2010-06-28:] Apparently, according to an anonymous source (a comment on the bottom of this page ;-) ) this problem does not exist in the Mac version of Safari.
And we at Rough Sea Games may just scratch out Safari 5 from our list of supported browsers. It doesn`t hurt too much, since we hardly get any visitors using Safari anyway.
Posted on 2010/6/11blog comments powered by Disqus
Imprint:![]() Small print: disclaimer |
Important People: Jörg Winterstein Jazzoid Dirk Schreiter Thomas Schreiter Chris Noeth Rafael van Daele-Hunt Lars Kranebitter Ronny Kober |
Important Links: sucodo (plagiarism detection) Gameforge Inside Hacker News Golem Heise SLAY RADIO |

