Closed
Bug 360656
Opened 19 years ago
Closed 14 years ago
LiveConnect JSObject.call() does not work in firefox 2.
Categories
(Core Graveyard :: Java: Live Connect, defect)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: slavcho, Unassigned)
Details
User-Agent: Opera/9.01 (Windows NT 5.1; U; en)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
This bug has been already reported for Macintosh, well it happens with the PC version too. The JSObject.call() method worked fine in Firefox 1.5, now it does not work with Firefox 2. There aren't any JSExceptions thrown. The JSObject.eval() still works fine.
Reproducible: Always
Steps to Reproduce:
1.Create a Java applet that calls JSObject.call("someJSFunction"), say from a button click handler.
2.Create a page that loads the applet and has a someJSFuntion JavaScript script. Show an alert() in the funtion.
3.Open the page.
4.Click the Java button
Actual Results:
nothing
Expected Results:
an alert box
Updated•19 years ago
|
Assignee: nobody → live-connect
Component: General → Java: Live Connect
Product: Firefox → Core
QA Contact: general → pschwartau
Version: unspecified → 1.8 Branch
Comment 1•19 years ago
|
||
I have the same experience: It seems, that most of the time, Java applets can use .call(), after the JavaScript at least once called a method in the applet, but before that, JSObject.call() just ends in nirvana without any exception.
Now I have found that JSObject.call() works fine when Firefox2 runs under 64bit Win2K3, but calling the applet from JavaScript does not work there :-(
Comment 3•19 years ago
|
||
Slavcho, there are some test cases maybe related to your description. Could you help run the following cases and we can get some more information:
1. http://poslfit.homeip.net/test/liveconnecttest.html for bug 329457.
Expected result: an alert window "Java can call JS alert()"; a table shows the "ok" result of the call between Javascript and Java.
2. http://www.hem.za.org/java_scripting.html for bug 338905.
Expected result: After clicking the button, an alert window with "PASS" shows up.
Hi Alfred,
1. The first test works fine. However the source code for that applet shows only JSObject.eval() calls, which work fine as I have mentioned in the first post. The problem is that I need to pass some parameters to JavaScript, and therefore I use JSObject.call(). JSObject.call() seems ignored, it doesn't even throw an exception. JSObject.call() still works fine under Firefox 1.5.
2. The second test pops an alert window with a "FAIL" message.
I have the Java 1.5 runtime, if that matters.
Happy New Year!
Comment 5•19 years ago
|
||
> 1. The first test works fine. However the source code for that applet shows
> only JSObject.eval() calls, which work fine as I have mentioned in the first
> post. The problem is that I need to pass some parameters to JavaScript, and
> therefore I use JSObject.call(). JSObject.call() seems ignored, it doesn't even
> throw an exception. JSObject.call() still works fine under Firefox 1.5.
>
The function Open (http://poslfit.homeip.net/test/liveconnecttest.java) uses JSObject.call() to pass the string argument back to Javascript. I guess that's what you want.
> I have the Java 1.5 runtime, if that matters.
>
I only have Solaris with Firefox 2.0+Java1.6.0 around. Not sure whether Java 1.5 is matter on Windows.
> Happy New Year!
>
You too:-)
Ok, I have missed that.
I will try to copy stuff from my applet to that test case and see what exactly breaks the call() method. A few things I can see immediately are
- my applet creates some Swing UI
- I use call(String, Object[]) and not call(String, String[])
I will update you on this tomorrow.
Actually the http://poslfit.homeip.net/test/liveconnecttest.html test does not work in Firefox 2 as expected. The text that the Applet tries to display through JSObject.call() is
"Java calls passed JS object method: ok"
However, call() does not work in ff2, so the applet does this:
if (retval == null) { Log("Java calls passed JS object method: null return"); }
The applet's Log method uses JSObject.eval(), which works fine, so Firefox 2 displays
"Java calls passed JS object method: null return"
While IE6, IE7, Opera and Firefox 1.5 all display
"Java calls passed JS object method: ok"
because there JSObject.call() works as expected there.
Comment 8•19 years ago
|
||
Slavcho, thanks for your verification.
Kenneth, could you take a look at this bug? I can reproduce it on Solaris.
Comment 9•19 years ago
|
||
> Kenneth, could you take a look at this bug? I can reproduce it on Solaris.
Oops, typo, I can't reproduce it on Solaris:
1. Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.8.1) Gecko/20061211 Firefox/2.0 and Java 1.6.0.
2. Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9a2pre) Gecko/20070101 Minefield/3.0a2pre and 1.7.0alpha.
Comment 10•19 years ago
|
||
i see the
Java calls passed JS object method: null return
With firefox 1.5.0.9 as well, so I'm not sure this is the same problem (unless something has broken in Firefox 1.5.0.X as well)
http://www.hem.za.org/java_scripting.html
also fails in Firefox 1.5.0.9...
I will test some earlier 1.5 builds.
Comment 11•19 years ago
|
||
It seems that if an applet calls a JavaScript function, that is not defined in the html page, then all following calls to JavaScript functions that are defined are not executed.
Also Firefox seems to have trouble selecting the right function if there are multiple functions with the same name, but a varying number of parameters.
The obvious workaround is to make sure all JavaScript functions are defined correctly.
Comment 12•14 years ago
|
||
Firefox code moved from custom Liveconnect code to the NPAPI/NPRuntime bridge a while back. Mass-closing the bugs in the liveconnect component which are likely invalid. If you believe that this bug is still relevant to modern versions of Firefox, please reopen it and move it the "Core" product, component "Plug-Ins".
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•