Bug 9761

Summary: LiveConnect string conversion fails for java.lang.Object
Product: WebKit Reporter: Marc Epard <marc>
Component: JavaAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bugzilla, ddkilzer, hendry, mrowe
Priority: P2    
Version: 412   
Hardware: Mac   
OS: OS X 10.4   
URL: javascript:alert(window.java)
Attachments:
Description Flags
xcode project for applet and web page that illustrate the problem
none
LiveConnect enabled check
none
proposed fix mjs: review+

Marc Epard
Reported 2006-07-06 12:44:18 PDT
The LiveConnect JavaScript-to-Java type conversion rules for JavaScript strings are at <http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:LiveConnect_Overview:Data_Type_Conversions:JavaScript_to_Java_Conversions#String_Values> They specifically that JavaScript strings are converted to java.lang.String for arguments of both java.lang.String and java.lang.Object types. On Mac OS X 10.4.7, though, only arguments of type java.lang.String work. java.lang.Object arguments become null. I'll send along an attachment with an example.
Attachments
xcode project for applet and web page that illustrate the problem (11.15 KB, application/zip)
2006-07-06 12:48 PDT, Marc Epard
no flags
LiveConnect enabled check (274 bytes, text/html)
2007-08-29 02:28 PDT, Kai Hendry
no flags
proposed fix (3.57 KB, patch)
2010-02-19 23:17 PST, Alexey Proskuryakov
mjs: review+
Marc Epard
Comment 1 2006-07-06 12:48:16 PDT
Created attachment 9236 [details] xcode project for applet and web page that illustrate the problem
Mark Rowe (bdash)
Comment 2 2006-07-06 15:25:52 PDT
Based on my reading of the LiveConnect documentation and a test of the provided applet, I can reproduce this issue with WebKit 418.8 and WebKit r15138.
Kai Hendry
Comment 3 2007-08-29 02:28:51 PDT
Created attachment 16150 [details] LiveConnect enabled check I can't get LiveConnect working on any Safari version on my new MBP 10.4.10 system. Perhaps I am missing a plugin? QuickTime Plug-In 7.2 iPhotoPhotocast Quartz Composer Plug-In Verified Download Plugin Java Plug-in for Cocoa Shockwave Flash QuickTime Plug-in 7.2 Google Update One-Click Installer Plugin
David Kilzer (:ddkilzer)
Comment 4 2007-08-29 06:57:53 PDT
(In reply to comment #3) > Created an attachment (id=16150) [edit] > LiveConnect enabled check > > I can't get LiveConnect working on any Safari version on my new MBP 10.4.10 > system. Is Safari set to run under Rosetta? Do a "Get Info" on the Safari application in the /Applications folder, and make sure the "Open using Rosetta" checkbox is unchecked. http://docs.info.apple.com/article.html?artnum=303120
Kai Hendry
Comment 5 2007-08-29 07:10:28 PDT
Found Rosetta unchecked. Does the "LiveConnect enabled check" test work for you?
David Kilzer (:ddkilzer)
Comment 6 2007-08-29 07:18:54 PDT
(In reply to comment #5) > Found Rosetta unchecked. > > Does the "LiveConnect enabled check" test work for you? No, it does not. Works on Firefox 2.0.0.6. Does not work on Safari 2.0.4 (419.3) with original WebKit on Mac OS X 10.4.10 (8R218). I am using a PowerPC-based PowerBook G4.
David Kilzer (:ddkilzer)
Comment 7 2007-08-29 07:23:16 PDT
Opening javascript:alert(window.java) in Firefox 2.0.0.6 returns: [JavaPackage java] This is undefined in ToT WebKit, so it would appear that the window.java object is not available. Opera 9.22 does nothing with the alert, but the test works properly (undetectable support?).
David Kilzer (:ddkilzer)
Comment 8 2007-08-29 07:35:45 PDT
(In reply to comment #5) > Does the "LiveConnect enabled check" test work for you? Kai, I believe your test demonstrates a different bug (no window.java object available in the DOM). Would you please open a new bug for this issue? Thanks!
David Kilzer (:ddkilzer)
Comment 9 2007-08-29 07:37:02 PDT
BTW, the original bug is still an issue. Here's how to compile the Java source file without Xcode: $ javac LiveConnectBug.java $ jar cf LiveConnectBug.jar LiveConnectBug.class After doing that, opening example1.html from the LiveConnectBug/ directory will demonstrate the original bug.
David Kilzer (:ddkilzer)
Comment 10 2007-08-29 14:58:54 PDT
(In reply to comment #8) > (In reply to comment #5) > > Does the "LiveConnect enabled check" test work for you? > > Kai, I believe your test demonstrates a different bug (no window.java object > available in the DOM). Would you please open a new bug for this issue? Bug 15109
Alexey Proskuryakov
Comment 11 2010-02-19 23:17:38 PST
Created attachment 49119 [details] proposed fix
Maciej Stachowiak
Comment 12 2010-02-19 23:25:07 PST
Comment on attachment 49119 [details] proposed fix r=me
Alexey Proskuryakov
Comment 13 2010-02-20 00:25:27 PST
Note You need to log in before you can comment on or make changes to this bug.