Closed
Bug 912880
Opened 12 years ago
Closed 8 years ago
No Java Applet access via Javascript on Mac
Categories
(Core Graveyard :: Plug-ins, defect, P3)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: mail, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36
Steps to reproduce:
1. Create an Applet:
import java.applet.*;
public class socketApplet extends Applet {
public void init() {
System.out.println("Applet initialisiert.");
}
public void start() {
System.out.println("Applet gestartet.");
}
public void paint() {
System.out.println("Applet aktualisiert.");
}
public void stop() {
System.out.println("Applet angehalten.");
}
public void destroy() {
System.out.println("Applet beendet.");
}
public String testApplet() {
System.out.println("Applet getestet.");
return "Yep, I'm the Applet.";
}
}
2. Compile it, pack it as a JAR and self-sign it.
3. Try to embed the Applet dynamically into a website:
var applet = document.createElement('applet');
applet.archive = 'socketApplet.jar';
applet.id = 'socketApplet';
applet.name = 'socketApplet';
applet.code = 'socketApplet';
applet.scriptable = 'true';
applet.width = '0';
applet.height = '0';
document.body.appendChild(applet);
4. Try to access the method testApplet() via Javascript in Firefox 23.0.1 on our companies Macbooks (OS X 10.8.4) with the latest Java version (7u25).
Actual results:
The applet is starting but the method is undefined. There is no access via Javascript to the applets methods.
The same setup on a Windows machine does work (same Java security settings but also tried lower security settings on the mac machines). Safari has no problem on our Macbooks.
Embedding the applet directly (via html, not via javascript) is no problem. i cann access the method testApplet().
As a solution to embed the applet dynamically i can embed an iframe dynamically with the applet inside the iframe. then i can access the applets methods.
See also:
http://stackoverflow.com/questions/18588104/how-can-i-call-java-applet-methods-with-javascript/18630547#18630547
Expected results:
The expected result is access on the applets method and a return of the string "Yep, I'm the Applet."
Reporter | ||
Updated•12 years ago
|
Hardware: x86 → x86_64
Reporter | ||
Comment 1•12 years ago
|
||
Maybe similar to this one but it is a different situation. accessing the methods works but not when embedding the applet via javascript
https://bugzilla.mozilla.org/show_bug.cgi?id=872969
Could you attach a testcase that works directly by loading a page with Firefox, please. (no need to compile whatever and run that on a server)
In addition, could you try with Nightly if the issue is present too.
http://nightly.mozilla.org/
Component: General → Plug-ins
Flags: needinfo?(mail)
Comment 3•12 years ago
|
||
This really sounds like bug 872969.
Does it work when you delay calling testApplet()?
Does it work when you use (and possibly delay calling testApplet()):
> var div = document.createElement('div');
> div.innerHTML = '<applet>...</applet>';
> document.body.appendChild(div);
Reporter | ||
Comment 4•12 years ago
|
||
Here is the test case: http://www.develign.net/dev/tests/osxffjava/ (download link included)
(1) does not work on mac but on windows (same ff and java version and settings)
(2) does work on my mac and on windows
(3) does work on windows and on my mac, but on my mac not every time in my test case?
I've tested the 3 cases with the current stable version and the new nightly build: same results.
Flags: needinfo?(mail)
Comment 5•12 years ago
|
||
Thanks for the clear test-case.
(3) sometimes not working could be bug 872969, (2) also fits with it. For (1), maybe that also accesses Javas scriptable object early (and why it would), that needs a further look.
Priority: -- → P3
Comment 6•11 years ago
|
||
This bug bites me too. I think it should no longer be considered UNCONFIRMED.
Comment 7•11 years ago
|
||
It would be nice, if someone could resolve this issue.
Comment 8•11 years ago
|
||
A solution that worked for us was to replace
jQuery('body').append(str);
with
var div = jQuery('<div/>');
jQuery('body').append(div);
div[0].innerHTML = str;
where str is the String defining the applet.
Comment 9•8 years ago
|
||
I'm marking this bug as WONTFIX per bug #1269807.
For more information see - https://blog.mozilla.org/futurereleases/2015/10/08/npapi-plugins-in-firefox/
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•