Take the 2-minute tour ×

Ok, so we have a Java applet, which provides the ability to upload files to server. Some have already noticed, that user needs to turn 'unsafe' java mode for our site in order for applet to work.

One way of determining the 'safeness' of java is try to load a 'fake' applet and see how it behaves. This will take some time to load JRE and is not what I want.

The question is: can we determine if java is running in unsafe mode with JavaScript ONLY? I'm really hoping Apple added such a possibility.

In fact, some links to where this behavior is described would be appreciated.

share|improve this question
add comment

1 Answer

I believe that you misinterpreted my original post re Java applet and Safari 7. Safari 7 does not actually "blocks" the applet from loading. The applet will be loaded precisely the same way as if it was loaded under Safari 6. The only problem is that Safari 7 (and not 6 and below) actually restricts the applet from accessing file system, if the applet is running in "safe mode" which is default setting.

So if your applet does not need to access local files (and maybe some other I/O, I didn't experiment with other options though) - it won't notice anything wrong.

However, as soon as your applet tries to access local filesystem, it will get FileNotFoundException.

So to me, the best way to check if the applet is in "safe mode" is to simply try to access a folder you know to exist and accessible to the user (I think you can start experimenting with "." or ".."). If instead of accessing the folder you will have FileNotFoundException, you can assume (and suggest to your user) that the applet is running in "safe mode".

Also I am absolutely certain that there is no way to check thru the js if particular applet is in "safe mode" or to inquire if Safari 7 is running all applets in either "safe mode" or "unsafe mode".

Hope this helps.

share|improve this answer
Yeah, I got that. The thing is - our applet does need access to the filesystem. The desired behavior is: user opens the page, and if applet is not authorized to access user's files, a message is shown. The bad news is - it takes pretty much time for the JRE to start, load the applet and check fs access. So I was looking for a way to do this in a somewhat hacky-workarounded-JS manner. –  Dethariel Feb 16 at 12:21
add comment

Your Answer


