Skip to content

Instantly share code, notes, and snippets.

@pieceofsummer
Created May 30, 2013 23:52
Show Gist options
  • Save pieceofsummer/5682153 to your computer and use it in GitHub Desktop.
Save pieceofsummer/5682153 to your computer and use it in GitHub Desktop.
Refresh cached website icon in Safari
#!/bin/bash
if [ -z "$1" ]
then
echo "Usage: $0 domain"
echo "Example: $0 google.com"
exit 0
fi
echo "Deleting cache for $1"
sqlite3 ~/Library/Safari/WebpageIcons.db <<EOF
delete from IconData where iconID in (select iconID from PageURL where url like '%://$1/%');
delete from IconInfo where iconID in (select iconID from PageURL where url like '%://$1/%');
delete from PageURL where url like '%://$1/%';
EOF
echo "Done. Now restart Safari for changes to take effect"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment