4

In Safari preferences there is an option to disable Java which is nice but a bit cumbersome. Is there a plugin/addon/extension or an easy way to toggle Java on/off?

Karan
  • 57,289

2 Answers2

3

You could use applescript to toggle Java off/on. Save the script as an application and call it with a hotkey or from a link.

The following worked for me (YMMV):

try
        tell application "Safari"
                activate
        end tell  
        tell application "System Events"
                tell process "Safari"
                        click menu item "Preferences…" of menu "Safari" of menu bar item "Safari" of menu bar 1
                        click button "Security" of tool bar 1 of window 1
                        click checkbox "Enable Java" of group 1 of group 1 of window "Security"
                        click button 1 of window "Security"
                end tell
        end tell
end try

Edit:
A link to the code:
http://pastie.org/private/ea7qbuareh6uje8zsglcia

minopret
  • 535
  • 4
  • 11
Chris
  • 1,042
2

With Safari open, hit Command, (command and comma together). When Preferences opens select Security. Uncheck the third box down that says Enable Java.enter image description here

Everett
  • 6,113
  • 1
  • 24
  • 34