JDK-6991224 : chrome: javascript to java call failed
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u27,6u33,7
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic,windows,windows_xp
  • CPU: generic,x86
  • Submitted: 2010-10-12
  • Updated: 2012-06-06
  • Resolved: 2012-06-01
Related Reports
Relates :  
Description
JRE build: 1.7.0-ea-b113

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. open java console and enable tracing in java control panel
2. open the following url in chrome:
http://sqeweb.sfbay.sun.com/jsn/users/fred/reproduce/chrome/NumberTest.html
3. check the output in java console

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
String "~~~~Calling Java From Javascript directly" is printed in java console
ACTUAL -
This string is not printed.

REPRODUCIBILITY :
This bug can be reproduced always. It worked well on firefox and IE.

The source code is at:
http://sqeweb.sfbay.sun.com/jsn/users/fred/reproduce/chrome

Comments
EVALUATION Moz. is going to remove this functionality (access to Java from the DOM) in FF15. We'll eventually remove the code in deploy workspace. Closing it as "will not fix".
01-06-2012

SUGGESTED FIX It is possible for us to introduce something along with applet as an extended attribute. Take following example developer can do in FF or IE today, // Need js engine collaboration to reserve syntax java.lang.System.out.println("Test message"); If we introduce a getJava() method as an example. Then developer can do the same thing with following code. This concept is similar to how we support IE, but instead of a global variable can be easily lost and no way to recover, this mechanism would be more comprehensive. // We can do it within plugin var a = document.getElementById("applet"); var bridge = a.getJava(); bridge.java.lang.System.out.println("Test message");
15-03-2011

EVALUATION To support Java.* or Packages.* namespace, we have a special arrangement with FF to support it. FF will create an instance of Java Plugin and not calling setWindow on it. If Chrome doesn't support such namespace, we have to talk to them.
16-02-2011