Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have the same problem! JavaScript calls a public method of an applet that is embedded in the same document. This should trigger that the applet loads some data from "home", so the connection should be opened to the same domain from where the applet was loaded - which should be allowed also for unsigned applets without further privileges.</p> <p>I also recognized this security exception only with Safari (5.0.2 for Windows, JRE 1.6.0_22). The same applet in IE and FireFox is doing well.</p> <p>I also believe that this is a bug in the Java Sandbox of Safari.</p> <hr> <p>EDIT: Using doPrivileged did not help but I found this workaround: If you "decouple" the JavaScript call from the requested execution through a timer event, the execution will no longer be prohibited by the security restriction that Safari puts into the game here. In detail:</p> <ul> <li>the method that is called from JavaScript only creates a javax.swing.Timer (to schedule one event so the repeat-property must be set false). You can set the delay quite short (e.g. 50 ms).</li> <li>The method call that is intended to be called has to be put into the ActionEvent listener (actionPerformed) which is called by the timer.</li> </ul> <p>One problem that might make things a bit more complicated is that in the actionPerformed context only static variables are accessible. If the JavaScript call contains variables, these must be put by the initially called method into a staic "buffer" variable from which the scheduled event can read the value afterwards.</p> <p>In my tests only the javax.swing.Timer provided the required decoupling whereas java.util.Timer could not be used for that purpose.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload