Closed Bug 563768 Opened 14 years ago Closed 8 years ago

App focus badly broken on trunk with latest Java Plugin2 and multiple applets

Categories

(Plugins Graveyard :: Java (Apple), defect)

All
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: smichaud, Unassigned)

References

Details

(Whiteboard: rdar://7941686)

This report is about the Java Plugin2 that comes with Apple's most
recent Developer Previews (Java for Mac OS X 10.5 Update 7 build
9M3150 and Java for Mac OS X 10.6 Update 2 build 10M3050).

Bad things happen when you use this Java Plugin2 in recent Minefield
nightlies to load multiple Java applets in a single page.  The same
problems happen with Safari, but (interestingly) not with Firefox
3.6.X or 3.5.X.

1) Visit any of the following URLs, all of which load more than one
   applet in a single page:

   http://java.sun.com/applets/jdk/1.4/demo/applets/MoleculeViewer/example3.html
   http://securitywizardry.com/radar.htm
   http://brittnysseafood.com/

   As the applets load, a Java Applet Host application will steal the
   app focus from Firefox.

2) Click anywhere in the Minefield window.

   The window and menu will flash, and focus will appear to be
   momentarily restored to Minefield.  But then the app focus will go
   back to Java Applet Host.

   Sometimes the menu display will be corrupted, and appear to contain
   parts of both the Minefield and Java Applet Host menus.  But if you
   click on any part of it, you'll see that only the Java Applet Host
   menu is active.

   It's now mostly impossible to do anything in Minefield -- even to
   quit the application.

   The workaround is to quit the Java Applet Host -- either from its
   Dock menu or its main menu.  Doing this also destroys all currently
   loaded Java applets.
Blocks: 554103
Whiteboard: rdar://7941686
I suspect this bug effects browsers that support the NPAPI Cocoa event model (like Minefield and Safari), but not those that only support the Carbon event model (like FF 3.6.X and 3.5.X).
Worthy of mentioning another test URL

http://www.cs.ubc.ca/~harrison/Java/sorting-demo.html
I can reproduce this on a stock 10.5.8, FF4b8, Java 1.5.0_26. Disturbing.
Still not fixed in Beta 13.
ChrisX:  This is an Apple bug, not a Mozilla bug.  It still also happens in Safari when you make it use Java Plugin2 (by choosing to run applets in their own process in Java Preferences).
That's why I chose to run Java applets within the browser process, which is also the system default. Why does Firefox not respect this setting? Bug?
> Why does Firefox not respect this setting?

Firefox can't use the JavaPluginCocoa.bundle plugin that Safari (and
other WebKit browsers) use -- Apple never provided a way for
non-WebKit browsers to do so.  Firefox 4 is also incompatible with the
Java Embedding Plugin (JEP), which allowed FF 3.6 and earlier to use
Java.  So FF4 must use Java Plugin2.

> Bug?

Not in Firefox.  This is a bug in the Java Plugin2.
> Firefox 4 is also incompatible with the Java Embedding Plugin

This is sad. I helped testing the JEP back in the day (which had its own problems). 
Thanks for your answers.
This is off-topic, but I actually *am* working on a new JEP that will
work with Firefox 4 (and potentially with any OS X browser that can
handle NPAPI plugins).  But it's been a lot more work than I
anticipated, so I'm not sure when I'll be finished with it.
This is certainly good news.
Interestingly, Apple has fixed this bug *today* with Java for Mac OS X 10.5 Update 9 (probably also for 10.6, but I don't have a 10.6 machine to test it).
Closing old bugs in the Plugins component. We aren't going to track issues in 3rd-party plugins in the Mozilla bug tracker. In addition, support for NPAPI plugins will be removed at the end of this year; for more details see the post at https://blog.mozilla.org/futurereleases/2015/10/08/npapi-plugins-in-firefox/

If there is a serious bug in Firefox, it needs to be filed in the "Core" product, "Plug-Ins" component.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
Product: Plugins → Plugins Graveyard
You need to log in before you can comment on or make changes to this bug.