I don’t like to browse the web with JavaScript and Flash and so-on automatically enabled unless I think I need it. A large percentage of ‘web annoyances’ can be avoided simply by turning off JavaScript and plugins unless you really need them. There’s also a security argument to doing this too.
In Firefox, I use NoScript to do this and it works really well. I’ve been using Safari more and more frequently in recent times, however, and I am not aware of a similar solution for the Mac’s default browser.
So I have devised a couple of AppleScripts, which were heavily inspired by and partially derived from the example on this Mac OS X Hints page. They allow me to toggle on and off JavaScript and plugins, respectively (I never have big Java switched on at any time!)
Please note that this is for Safari for Mac OS X only and is designed specifically for the new Snow Leopard Services functionality.
I have created them as Automator Services. The benefit of making them Services is that you can then assign a keyboard shortcut directly to the script and be able to simply press that keyboard shortcut to quickly invoke the script and do the toggle. It’s a lot quicker than hunting through a script menu or launching an application and doesn’t require any third-party software.
If you’d like to use these Services, download them below. Once unpacked, drop the files in ~/Library/Services, go to System Preferences > Keyboard > Keyboard Shortcuts, select Services from the list and assign your desired shortcut to the two scripts.
These scripts use Growl to notify you of the toggled state after the script has run. You’ll need Growl installed to make full use of it.