Closed Bug 199740 Opened 21 years ago Closed 21 years ago

Applets communication fails if loadedd from chrome:// URLs

Categories

(Core Graveyard :: Java: OJI, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 87088

People

(Reporter: burton, Assigned: joshua.xia)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030307
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030307

If you load an applet from XUL and a chrome:// URL it will fail. 

The Java plugin throws the following exception .

java.net.MalformedURLException: unknown protocol: chrome
	at java.net.URL.<init>(URL.java:586)
	at java.net.URL.<init>(URL.java:476)
	at java.net.URL.<init>(URL.java:425)
	at sun.plugin.AppletViewer.setDocumentBase(AppletViewer.java:855)
	at
sun.plugin.viewer.MNetscapePluginObject.setDocumentURL(MNetscapePluginObject.java:757)
	at sun.plugin.navig.motif.Plugin.doit(Plugin.java:297)
	at sun.plugin.navig.motif.Plugin.start(Plugin.java:103)

I looked at the SUN code on this.  They are obviously creating a java.net.URL
and it is throwing an exception because it isn't a known scheme.

Right now I am doing this from XUL with <xhtml:applet> tags.  

A workaround would be to load a chrome protocol handler.   The problem right now
is that there is no way to install a jar or class into Mozilla so that this is
passed to Java when it starts up.

Can OJI be modified to pass a MOZILLA_FIVE_HOME/classes directory into the Java
classpath so that developers can put code here which is needed for Java?  This
seems like it would be a good idea anyway.

This way I could write a protocol handler to work around the bug in OJI.

A workaround is to load the XUL from the filesystem with a file:// URL but this
has problems for my scenario

Reproducible: Always

Steps to Reproduce:
1.
2.
3.



Expected Results:  
The applet should load fine.
Another note... the Applet will still function as long as you don't use java ->
javascript communication.  In my situation I am trying to call methods on
javascript objects from my applet.  Since the AppletViewer code throws an
Exception when trying to initialize the applet it kills communication and when I
try to do:

aggregationEventListener = (JSObject)window.getMember( "aggregationEventListener" );

it will return null ... if loaded form the filesystem via a file:/ URL it will
return an object.
and the same as 87088
it seems that JPI have no plan to support chrome

*** This bug has been marked as a duplicate of 87088 ***
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.