firefox 4: problem with NPN_GetURL target=_self

Deepak Bhole dbhole at redhat.com
Tue Apr 19 09:55:36 PDT 2011


* Andriy Gapon <avg at icyb.net.ua> [2011-04-19 12:43]:
> on 19/04/2011 19:32 Deepak Bhole said the following:
> > Which version of Firefox are you using? I tried the above scenario on FF
> > 4.0 in Fedora 15 and saw no recursive calls. 
> 
> I have Mozilla/5.0 (X11; FreeBSD amd64; rv:2.0) Gecko/20100101 Firefox/4.0.
> 
> > Having JS call a Java method which then calls NPN_GetURL (via
> > AppletContext.showDocument()) worked fine for me.
> 
> Just to double-check, you used showDocument(url, "_self") ?
> 

Yes, this is the code I used:

$ cat Test.java 
import java.applet.Applet;
import java.awt.Graphics;
import java.net.URL;

public class Test extends Applet {
    public void changePage(String url) {
        System.err.println("Attempting to go to: " + url);
        try {
           getAppletContext().showDocument(new URL(url), "_self");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


$ cat Test.html 
<HTML>
    <HEAD>
        <TITLE> NPN_GetURL Test </TITLE>
    </HEAD>

    <BODY>
        <APPLET CODE="Test.class" NAME="testapplet" WIDTH=150 HEIGHT=25></APPLET>
        <FORM NAME="test">
            <INPUT TYPE="button" VALUE="test" onClick="testapplet.changePage('http://www.google.ca')">
        </FORM>
    </BODY>

</HTML>

Cheers,
Deepak

> -- 
> Andriy Gapon



More information about the distro-pkg-dev mailing list