Showing posts with label safari. Show all posts
Showing posts with label safari. Show all posts

Tuesday, June 7, 2011

Calvin and Hobbes GoComics Widget


My family and I are sworn Calvin and Hobbes fans. I have followed Calvin and Hobbes on my Mac's Dashboard Widget called FreeComics. FreeComics used to pull many comic strips from gocomics.com. A few days ago, GoComics changed the URL format for Calvin and Hobbes and made it very difficult to link to the image file. As a result, my widget stopped working and I was left wanting for Calvin and Hobbes. Reading the newspaper is unthinkable. Indian newspapers' quality decays exponentially. The quality of journalism and ethics is lower than a worm's belly button.

I had to find an alternative for my Calvin and Hobbes Dashboard Widget. There was no way I was going to visit GoComics.com's website for my daily dose of C&H and nor was I going to subscribe to their email service.

The solution was absolutely elegant and brilliant. For quite a while now, Safari has provided a feature called Web Clips. Web Clips allow you to take a snippet of any web page and place it in your Dashboard as a widget. So all I had to do was:

a) Navigate to http://www.gocomics.com/calvinandhobbes in Safari.

b) Click on the Web Clips icon (the one with a scissor).

c) Mouse over the comic image and select the nearest matching web page element.

d) Click in the selected element and adjust the size if needed.


When done, click Add in the top right bar, and voila, you have your Dashboard web clip! Enjoy your comics distraction-free!

Thursday, August 20, 2009

Safari - delete permanent cookies


Permanent cookies are a pain. I don't want to save any permanent cookies on my system.

Firefox allows me to automatically dump all permanent cookies when closing the browser:


Safari has no such option. Apple - this is a suggestion for you.

I have been tricking browsers into dumping cookies since 2001. For Netscape Navigator on Unix, it was easy. Simply symlink the cookies.txt file to /dev/null :) This forced every cookie to be treated as a session cookie.

For Safari, I had to write a wrapper script.

  1. Go to /Applications/Safari.app/Contents/MacOS
  2. Rename "Safari" to "Safari1"
  3. Create a shell script called "Safari" in the same directory as follows

#!/bin/sh
rm -f ~/Library/Cookies/Cookies.plist
${0}1 $*
rm -f ~/Library/Cookies/Cookies.plist

This will cause Safari to erase all cookies upon launching and exiting. Crude, but works.