For now, wait. Ideally, you could use the same code as in Mozilla, but that code does not work in Safari at the moment, and as far as I can tell it's not a simple browser-sniffing issue. Something isn't working right, and people haven't figured out exactly what yet. It may be a Safari bug.