The DOM APIs for Java Applets don't work in Firefox on the Mac but work on Safari for the Mac. This code in an applet should get the page title:
@Override
public void start() {
System.out.println("Started");
try {
DOMService domservice = DOMService.getService(this);
DOMAction action = new DOMAction() {
public Object run(DOMAccessor domAccessor) {
HTMLDocument doc = (HTMLDocument) domAccessor.getDocument(DHTMLApplet.this);
return doc.getTitle();
}
};
String title = (String) domservice.invokeAndWait(action);
System.out.println(title);
} catch (DOMUnsupportedException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (DOMAccessException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
Logged In: YES
user_id=848669
Originator: NO
I've confirmed your report. Here's the top part of the error I got in
the Java Console:
netscape.javascript.JSException: Unable to obtain Window object
at sun.plugin.dom.DOMServiceProvider.getDocument(DOMServiceProvider.java:57)
at sun.plugin.dom.DOMAccessor.getDocument(DOMService.java:84)
at DOMTest$1.run(DOMTest.java:30)
at sun.plugin.dom.DOMService.invokeAndWait(DOMService.java:46)
at DOMTest.start(DOMTest.java:35)
at sun.applet.AppletPanel.run(AppletPanel.java:378)
at jep.AppletFramePanel.run(AppletFramePanel.java:176)
at jep.RunnableWrapper.run(RunnableWrapper.java:110)
at java.lang.Thread.run(Thread.java:552)
Apple's JVM is in many ways written to work only with WebKit-based
browsers (like Safari). This problem is probably yet another example.
I had a similar problem with cookies -- I had to spend quite a lot of
time working around insufficiencies in Apple's JVM to make it possible
for the Java Embedding Plugin to access the browser's cookie store.
It's likely that I'll have to do something similar here ... though I
hope it won't be quite as much work.
With luck, I should be able to resolve this problem sometime within
the next couple of months.