Skip to content

Instantly share code, notes, and snippets.

@hoffrocket
Last active December 14, 2015 00:18
Show Gist options
  • Save hoffrocket/4997472 to your computer and use it in GitHub Desktop.
Save hoffrocket/4997472 to your computer and use it in GitHub Desktop.
Applescript to disable java in safari
#!/usr/bin/osascript
activate application "Safari"
tell application "System Events"
tell process "Safari"
click menu item "Preferences…" of menu 1 of menu bar item "Safari" of menu bar 1
click button "Security" of tool bar 1 of window 1
set theCheckbox to checkbox "Enable Java" of group 1 of group 1 of window "Security"
tell theCheckbox
if (its value as boolean) then click theCheckbox
end tell
click button 1 of window "Security"
end tell
end tell
@hoffrocket
Copy link
Author

You can run with something like this: curl https://gist.github.com/hoffrocket/4997472/raw/disable-java.applescript | osascript

@leothekim
Copy link

You can also sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment