Archive for February, 2009

Capturing right-click mouse events in Safari in elements positioned above a plug-in (e.g. Flash)

5Feb 09

I’ve just been looking into an issue raised by a couple of very intelligent former colleagues of mine, James Head and Guy Whitfield, which has everyone stumped. It appears that there is an issue with plug-ins in Safari which results in no mouse button event being fired in JavaScript when using the right mouse button (context menu) on any portion of an element positioned absolutely over that plug-in.

It’s like the plug-in captures the event, bringing up its own context menu, but doesn’t pass the event onto JavaScript / the page to handle.

Actions speak louder than words so here’s a demo: http://web.me.com/denodell/safari-plugin-bug/

Before it gets mentioned, yeah we’ve raised it as a bug against WebKit so hopefully it can be fixed before Safari 4.0 is released: https://bugs.webkit.org/show_bug.cgi?id=23759

If you have any solutions, please add them in the comments. We’ve tried everything, including shoving everything in <iframe>s, etc…

Tags:
Posted in Web Development

Interested in JavaScript and RIAs?

I wrote a book for web developers building RIAs and web applications who need to be sure they are writing high quality and efficient code whilst constructing advanced user experiences.