Skip to content

Blog

Toggle JavaScript and Plugins in Safari

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.

System Preferences Keyboard Shortcuts

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.

Download the Toggle JavaScript and Plugins scripts (zip archive, 270 KB)

AppleScript to enable SOCKS proxy on Mac OS X

Find this tutorial useful?





Well, I’m here at Reading University and one of the joys of living here in halls is using the wonderful internet connection, shared with many other download-happy students.

As well as the speed being quite variable, there’s also a greater security risk, especially when transmitting passwords over normal, unencrypted HTTP connections. To solve that problem, I SSH into my server, still sitting back at home and tunnel HTTP traffic through the SSH connection.

This creates a SOCKS proxy server on my local machine and I can push the Mac’s traffic through it. It takes a long time and is fiddly, however, to switch the SOCKS proxy on and off from System Preferences, especially when (as in my special case) you can’t use Leopard’s Locations feature.

The AppleScript applications provided below are a quicker solution. Launch the right app, type your password and the proxy is flipped on or off. Nice and simple and much less fiddly than messing around in System Preferences.

» Read the rest of this post…

HP DeskJet F2180

I got a new printer today. Actually, it’s a printer and scanner and copier, All-in-One sort of device. It is the HP DeskJet F2180, found for £30.

It’s replacing my ageing and rather incompatible Lexmark Z45. The Z45 was bought a very long time ago, back even before I started using Linux. Back then, compatibility with alternative operating systems wasn’t a priority and ever since I have been dogged with issues printing from my own machine.

HP DeskJet F2180

» Read the rest of this post…

Some old iMacs

I got an opportunity recently to play around with some old iMac DVs (late 1999 or early 2000 by the looks of things) that had been lying around unused for a while at college.

Three iMacs

So now, instead of lying around with no system software loaded on them, they are being put to use. Two are running OS X 10.1 and the other one that is up and running is running OS 8.6.

iMac running OS X

It’s always good to play with older stuff, and it’s nice now that they can be put to use (which I imagine will involve reinstalling Mac OS lots of times as part of the Operating Systems unit).

Firefox 3 Beta 2 on Mac OS X

Firefox on the Mac is, well, it doesn’t always fit in quite as well with the Mac as it could – and it feels like that’s always been the case.

Firefox 3 is meant to start changing that, and making Firefox feel like a first class citizen on OS X. Having heard Jacob’s singing praise for the beta’s integration with GTK on Linux, I thought I’d download the Mac build and give it a try.

The first thing you’ll probably notice is real native buttons. Instead of Windows 95-style boxy buttons, native Mac buttons are now used, unless the website specifies specific button colours, in which case those colours and styles are used on the standard boxy buttons (exactly the same as Safari 3 now does).

There’s also a new theme available, called Proto. It doesn’t ship with the beta, but is linked to from the welcome page you get. And this is what it looks like:

» Read the rest of this post…

iPhone in the O2 Store

I finally had time to walk into an O2 store today and have a brief play with the iPhone.

And I’m pretty impressed. On a sidenote – I’ve decided to go for an iPod Touch, which is actually scheduled to arrive tomorrow, but since it’s a part Christmas present, it won’t be getting any usage for 42 days from today.

I was a little concerned about the iPhone keyboard, but even in about 10 minutes, I picked up how to use it and became pretty good and considerably quick for a small keyboard. Which is a good sign, as I’ll be getting used to it more on the Touch.

The applications all worked really well – the multi-touch interface is very well done and it feels very intuitive to just pick up and use. I mean, I would say that, as I tend to pick things up quickly anyway, but it did seem genuinely intuitive.

My only complaints from what I’ve seen about the device itself are the fingermarks on the screen (the demo iPhones there had seen a lot of fingers) and Safari occasionally rendering a little slowly on some pages. I can confirm, however, that my site looks just as it does in Safari on OS X on the iPhone. 🙂

Of course, my major complaint is the contract lock-in, which is why I’m getting the Touch and not the iPhone itself. It’s a shame, as Mail, SMS, Google Maps and the Phone functionality on the iPhone do look very nice.

Quick tip if you do walk into O2 or the Apple Store and play around – if you do log in to anything in Safari. and then just idly tap the Home button thinking you quit Safari, beware. Anyone who goes back on Safari will arrive at the page you were last – logged in and all. I’d recommend you log out explicitly from whatever sites you visit, close all pages with the bottom right icon in Safari and then clear History, Cache and Cookies in Settings from the home screen. Or, don’t log in to anything. 😛

I’m now going to have to resist the temptation to walk back into O2 during lunch breaks just to have another play! 😉

Thoughts on Time Machine

Time Machine icon

Of all of the new features in Leopard, Time Machine definitely looks one of the most significant and as a concept it looks pretty neat.

Over the last few days, I’ve put Time Machine into practice and I’d like to share my thoughts.

  • The initial backup after you set it up is a pain. The entire system gets backed up (40 GB in my case, when I’d set it up) and you get an annoying progress window. It doesn’t quite happen in the same ‘in the background’ way it’s promised initially. The initial backup can’t be interrupted either – it’s a good thing it only has to be done once.
  • Subsequent backups are completely automated, in the background and incremental. Provided you don’t shift around tons of data in the space of an hour while your drive is connected, there’s very little to back up each hour so it happens virtually instantaneously and you don’t notice it.
  • The interface is very eye-candy-y and I think some of the effects can get in the way a little bit when you’re just trying to restore something. However, being able to use the full power of the Spotlight architecture inside your backups is pretty cool and is a real boon when trying to find a specific file from a specific backup.
  • A little more configurability with regards to how much disk space Time Machine uses and retention policies would be nice. How it’s done right now does keep it simple, but how hard would it be to implement a slider as to how much of the drive to use. Right now, it means you have to re-partition the drive with a data partition too if you want to do so, as the backup partition is completely monopolised by Time Machine.
  • The backups aren’t in some crazy proprietary format – they’re just the files copied to directories on the disk. It’s simple to restore files even without using the Time Machine interface and all your data is nice and accessible. That means if I have a major MacBook catastrophe, I can plug the backup drive into my Linux box, mount the HFS+ partition and copy my files. Interoperability for the win.
  • Having backups completely automated is going to save me so much time and effort – and my backups wll be more up-to-date, should I ever have to use them (I haven’t yet on the MacBook).

So, overall – Time Machine is a really cool feature. If they add some more options to configure it just how I like it and maybe offer a toned down interface as well, it will be the most awesome desktop backup solution ever.

Leopard is here

So Leopard is here and it is very very nice. I haven’t had an awful lot of time to actually sit down and just play – it’s mostly copying stuff from my backup over, getting things running smoothly again. I will report back with thoughts later!

Picture 2

As you can see, Spotlight is furiously re-indexing all the stuff I just copied, so it is pegging my CPU (usually just one of the cores though, so it’s still snappy and responsive) and making it very very hot (see the menubar for the CPU core temperature)!

More Leopard stuff soon.