Safari 1.2 was released today. So was Java 1.4.2 for Mac OS X. Safari naturally gets most of the attention; a mere Java dot-dot release rarely merits more than a paragraph at MacNN.
While the updated Safari is great, what’s even better is something that required work in both Safari and Java. For the first time ever, the Mac now has terrific support for Java-to-Javascript communication. This is the most common form of what’s typically called “LiveConnect” — communication between Javascript and a plugin.
I’ve been waiting more than five years for this. I first posted to mrj-dev asking for LiveConnect on the Mac in November 1998. (I still have the message.) I was working for Homestead at the time and trying hard to port their Java applet to the Mac. Back in those days, “write once run everywhere” was still a viable theory, so I thought the port would be easy. And on the Java side, it was…until I ran into Homestead’s LiveConnect code. I tried some of the most creative hacks imaginable, like an invisible HTML frame into which the applet would insert dynamically generated code that included the right Javascript bits to talk to other static Javascript code on the same page, but two-way communication between Java and Javascript just wasn’t possible.
After Homestead, I interned for Apple’s Java team and pushed to implement LiveConnect there. No dice — it needed far more support on the browser side than on the Java side, and Microsoft didn’t seem to want to do the work required for IE to support it. The next year, I interviewed with the Mac IE team. They were planning to give me an offer, but I asked if we could determine what I’d be working on first. (This was back when interns could pull silly stunts like that.) I suggested LiveConnect. They suggested working on other parts of the browser. I countered with LiveConnect. They countered with WebTV. I gave up and went back to Apple, but I never stopped trying to convince people that the Mac needed LiveConnect.
It’s been a long time, and unfortunately it’s probably too late to be of much importance. Java applets aren’t nearly as prevalent on the Internet as everyone in 1998 thought they’d be. Even my former colleagues at Homestead decided to write a Windows application rather than deal with the problems of Java in the browser. But some sites persevered, and for those, today is a great day for their Mac users. It’s been more than five years, but now, finally, LiveConnect works.