Skip to content

Instantly share code, notes, and snippets.

@atmos
Last active December 13, 2015 23:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atmos/4992469 to your computer and use it in GitHub Desktop.
Save atmos/4992469 to your computer and use it in GitHub Desktop.
Disable Java in Safari 6

Disable Java in Safari 6

I keep coming across articles talking about browser vulnerabilities related to java. Apparently I don't have to worry about Chrome or Firefox, but it appears Java is enabled by default in Safari.

I had a hard time finding documentation on the correct safari defaults to set to disable Java in Safari 6.

If you really need to run java for some shit, keep it off by default and turn it on when needed.

To Disable

defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -boolean NO
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -boolean NO

To Enable

defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -boolean YES
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -boolean YES

Nuke it from your system

I just said fuck java and ran this too.

sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
@soffes
Copy link

soffes commented Feb 20, 2013

I went with a slightly less destructive approach. I can see future self yelling at current self while I'm already pissed that I need Java for some terrible bank website or something.

sudo mkdir -p "/Library/Internet Plug-Ins (Disabled)" 
sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin "/Library/Internet Plug-Ins (Disabled)/JavaAppletPlugin.plugin"

@mattreduce
Copy link

Is it not possible to uncheck "Enable Java" and accomplish the same?

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