Skip to main content

JSObject and Gecko based browsers

No replies
Joined: 2003-11-02

Hi all,

I spend a day to search Java forums and the internet to find an answer to the following problem, but had no luck. So, I hope someone in this forum can shed some light on it.

This code runs fine in IE but all Gecko based browser are treating it as a popup and block it:

<br />
in applet:<br />
...<br />
try {</p>
<p>    URL url = new URL(applet.getApplet()                          .getCodeBase(), "/something/mypage.jsp");<br />
    JSObject window = JSObject.getWindow(applet.getApplet());<br />
    window.eval("launchNewURL('" +url+ "')");<br />
}<br />
catch (Exception e) {<br />
    e.printStackTrace();<br />
    System.out.println("Bardu: " + e);<br />
<p>in html</p>
<p>    function launchNewURL(URL) {<br />;<br />

Will this not work anymore in the futher? (I had that problem with JDK1.5.0_06 and 07)
Are there any other ways to open a new browser window from an unsigned applet?

Any helpful infos are highly appreciated.