[oXygen-sdk] Problems running applet with latest Safari updates on Mac OS X

Oxygen XML Editor Support support at oxygenxml.com
Thu Oct 24 03:21:50 CDT 2013


Hi everybody,

Using the latest Safari updates (Safari 7 on OSX Mavericks for example) 
the Author Web Component bundled as a Java Applet fails to start because 
it no longer has permissions to write files to the user home folder. 
This happens despite the fact that the applet is signed and requests all 
permissions. The applet still runs fine with Firefox on Mac.

This is caused by the fact that Safari added per-site controls for each 
applet. Users should be encouraged to go to the 
'Safari->Preferences->Security page', click on the 'Manage Website 
Settings' button then select Java and for the corresponding site entry 
choose the 'Run in Unsafe mode' option.

More details can be found here:

http://www.intego.com/mac-security-blog/apple-safari-now-offers-per-site-java-enabling/

A workaround to avoid users having to change settings would be that in 
the Java code of the "ro.sync.ecss.samples.AuthorComponentSampleApplet" 
class before the startAppletInit() method is invoked to add the code:

> if(new File(System.getProperty("user.home")).listFiles() == null) {
> 	//Problems with Safari 7 on MAC, applet by default runs in safe mode and cannot create files in user home.
> 	JOptionPane.showMessageDialog(AuthorComponentSampleApplet.this,
> 			"Applet does not have permissions to access the user home folder to store its resources cache.\n" +
> 			"If you want to remove this warning and you are running the Applet using Safari on MAC OS X \n" +
> 			"please go to the 'Safari->Preferences->Security page', click on the 'Manage Website Settings' \n" +
> 			"button then select Java and for the corresponding applet site entry choose the 'Run in Unsafe mode' option.",
> 			"Cannot write applet resources to user home", JOptionPane.WARNING_MESSAGE);
> 	//EXM-28624 If we have trouble accessing the user home we'll use the temporary files directory instead.
> 	System.setProperty("user.home", System.getProperty("java.io.tmpdir"));
> }

which would instruct the applet to save its settings and resources to 
the temporary files folder each time it gets started, increasing the 
load time. The applet will still not have rights to access any file 
outside of that folder. Also if the user has a fixed license key, the 
applet will always show him the license registration dialog.

-- 
Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com



More information about the oXygen-sdk mailing list