Bug 17586 - In applet init function, passing 'this' to JS function causes MalformedURLException
Summary: In applet init function, passing 'this' to JS function causes MalformedURLExc...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Java (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-27 20:58 PST by Michael A. Puls II
Modified: 2023-09-15 08:30 PDT (History)
1 user (show)

See Also:


Attachments
Two applet tests (included java sources) (3.97 KB, application/zip)
2008-02-27 21:03 PST, Michael A. Puls II
no flags Details
IE-compatible test (3.35 KB, application/zip)
2008-02-27 23:48 PST, Michael A. Puls II
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael A. Puls II 2008-02-27 20:58:33 PST
Safari 3.1.525.9

Passing 'this' from an applet to JS doesn't work in Safari. Works fine in FF, Opera and IE.

Will attach examples.
Comment 1 Michael A. Puls II 2008-02-27 21:03:19 PST
Created attachment 19428 [details]
Two applet tests (included java sources)

Test1 tries to pass 'this' to JS and doesn't work in Safari. Test2 doesn't try to pass 'this' to JS and things work fine. They both work fine in FF and Opera.

.class files were built with Sun jdk6-u4 (win32) and I'm using jre6-u4.
Comment 2 Michael A. Puls II 2008-02-27 23:48:32 PST
Created attachment 19431 [details]
IE-compatible test

Here's test1 again, but it uses the applet element so you can compare with IE also. It works in IE, Firefox and Opera, but fails in Safari.

The actual error the java console shows is:

java.net.MalformedURLException: no protocol: 
	at java.net.URL.<init>(Unknown Source)
	at java.net.URL.<init>(Unknown Source)
	at java.net.URL.<init>(Unknown Source)
	at sun.plugin.liveconnect.SecureInvocation.checkLiveConnectCaller(Unknown Source)
	at sun.plugin.liveconnect.SecureInvocation.access$000(Unknown Source)
	at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)
	at sun.plugin.javascript.navig5.JSObject.JSObjectInvoke(Native Method)
	at sun.plugin.javascript.navig5.JSObject.invoke(Unknown Source)
	at sun.plugin.javascript.navig5.JSObject.call(Unknown Source)
	at AppletTestOne.init(AppletTestOne.java:13)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Comment 3 Joshua 2008-04-25 06:48:11 PDT
We have the same problem on Safari. We are also getting the following when a http connection is initiated when in a javascript to java live connect call.

java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.0.17:80 connect,resolve)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkConnect(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.<init>(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
Comment 4 Alexey Proskuryakov 2023-09-15 08:30:01 PDT
Java applet support is long gone, closing.