10/02/05

Skinning sites in Safari with PithHelmet

It would easy to to think that Firefox is the only browser with cool extensions, and overlook the excellent ones available for Safari, such as Saft, Stand and PithHelmet.

Like Saft, PithHelmet started life as an extension with a single purpose, and and has since grown beyond its remit. Starting life as an advert blocker, PithHelmet now boasts powerful per-site preferences, and the ability to apply custom css AND Javascript to individual sites. This takes Omniweb’s site preferences and expands it even further.

Late last year I began playing with the custom css function, and while it didn’t work at first (preferences weren’t saved after quitting Safari), Mike Solomon, PithHelmets developer, soon ironed out all the glitches. Its been a real pleasure to communicate with Mike. I’ve questioned, he’s responded with new versions, and now he’s added the ability to create a single theme file that can be sent to others. Dragging a site rule from the preferences window into the finder creates .phr file (Pith Helmet Rule), but now it will include all the css, javascript and images for your site skin.

Why bother skinning a site? Actually, there is a purpose of sorts. Lets say for example that you’re a heavy Gmail user, but you’d like the interface to look a little less PC. With a site skin you could alter it to look more OS X.

So here’s the one I’ve been working on. A Spotlight-ish skin for de.licio.us. The start of this idea came from Tom Coates mockups of bookmark tagging inside Safari. My aim was to make de.licio.us look more like a part of my browser, rather than a web page.

delicious after being skinned

(click image for full sized version)

If you’d like to give it a go, download this site rule (ctrl-click and ‘Save linked file as’), and then drag and drop it into PithHelmets site preferences window. That should be all you have to do, but this is a ‘first try’, so do let me know if anything goes wrong.

The css for this is a bit quick and sloppy. I’ve coded it so that the css can be used in a usercontent.css (that would get applied to every site), so while it’s flexible, it could be cut down when being used in the PithHelmet context. Ways to improve this (if I had the time) would be to use a javascript to dynamically create classes for the alternating rows, rather than the limited adjacent sibling selector method that I used in the css. All in all, it’s not perfect, but its enough to demonstrate what you can do. Someone with more time could take this and improve on it.

To create your own site theme, you have to use copious amounts of the inherit value to override the site’s own css rules. Then once you’re ready to go:

  1. visit the site you want to change in Safari
  2. open up PithHelmet menu>Show Site Preferences. If you haven’t already set preferences for that site, it will be at the bottom of the list.
  3. under ‘style’ select your custom css, and javascript, if applicable.
  4. type in a theme name
  5. If your theme requires images, create a directory with the theme name:
  6. /Library/Application Support/PithHelmet/com.apple.Safari/themename and then add the files to that directory
  7. make sure that images in your css file refer to file:////Library/Application%20Support/PithHelmet/com.apple.Safari/
  8. themename/newlogo.png (You can leave the ~, as this will choose the current users home directory, and allow the theme to be used by others). If it all looks OK, drag and drop the theme onto the finder, and this will create the .phr file with all the theme information.

The ability to create an easily sharable site theme opens up possibilities. Sites like de.licio.us are perhaps a little easier than some to theme, as all the styling is done with external css.

So, who’d like to have a go?

Technorati TagsTags: , , , ,

Comments | RSS

#1

Chris Biagini said 1192 days ago:

What an incredible feature. I’ve been wanting something like this ever since I saw OmniWeb’s site preferences, but I never imagined having JS as part of the deal. I hope the OW team is paying attention…

And the del.icio.us makeover looks great :)
#2

Justin Williams said 1192 days ago:

Beautiful!

This is the kind of stuff I hope the Safari team will implement on its own in the future.
#3

Jinjiru said 1192 days ago:

This is brilliant!
I always wanted to move the tag bar to the left which is more accessible way (at least for me).

Thank you.
#4

Paul said 1192 days ago:

Looks like I know what I’m going to be fiddling about with tonight…!
#5

sspboyd said 1192 days ago:

Very nice. I like it alot.
I have noticed a minor glitch.
When using the experimental posting bookmarklet, the list of tags (recommended tags, your tags and popular tags) is shifted over to the right too far. Like I said, minor glitch.
Thanks for doing this.
#6

Matt Carey said 1192 days ago:

works great—cheers jon!
#7

Jon Hicks said 1192 days ago:

#5 – sspboyd – what “experimental posting bookmarklet”? Using the one provided by delicious its fine here, but you do you have some fancy-schmancy bookmarklet?
#8

Wilson Miner said 1192 days ago:

John, here’s the bookmarklet you’re looking for. It suggests popular tags for the item you’re posting based on what other people have tagged that link, and suggests popular tags that overlap with tags already in your list. Very nice – Flickr needs something similar.

One thing I wonder about PithHelmet is if it will open me up to the same interminable Safari slowdowns that eventually forced me to drop Saft. Have you noticed any performance drags, especially after having Safari open for long periods of time?
#9

Jordan said 1192 days ago:

You know, you’ve got a bug in your screen grab. The “Identikal” item should have a grey background, but it’s white like the one above it. Perhaps you didn’t add enough of those fugly-long rules in the css?

Other than that little thing, it looks quite beautiful, and far better than the default. I’m on a PC, but I’m gonna save your css for possible mining. :)
#10

Max said 1192 days ago:

Jon, that’s quite evil—introducing me to the drug that is OmniWeb, and then telling everyone “hey, but Safari+SomeExtension is cool, too!” =]

Grr.

But does it do workspaces? =]
#11

Jon (notHicks) Bakke said 1192 days ago:

Three suggested changes, which make it easier to view the Related Tags column. Now, I’m not very experienced with CSS, so grain (bag?) of salt, and all.

DIV.delMain { }
Add float: left ! important ;

DIV.delPost { margin-left: 160px ! important; }
Change to 10px

DIV.delRight + DIV.delRight + DIV.delPage + DIV.delMain { margin-left: 161px !important; }
Change to 6px
#12

Chris J. Davis said 1192 days ago:

I loathe you Jon Hicks, you and your tom foolery and CSS goodness! How am I supposed to get anything done now! I am going to be skinning sites at random from now on! Bah.
#13

Michele said 1192 days ago:

Jon, did you know a similar thing has been done with Firefox and the URIid to another popular website ?
#14

Swaroop C H said 1191 days ago:

Greasemonkey1 for Firefox allows you to write Javascript per website as well!

[1]: http://greasemonkey.mozdev.org/
#15

eddmun said 1191 days ago:

I saw something about making complete (?!) applications in firefox using XUL or something… I think it was this site

I like the fact you have Franz Ferdinand on your playlist :)
#16

Anthony Baker said 1191 days ago:

Man, first you lure me over to Omniweb from Safari and now you pull a cool hack out of your bag of tricks that only works on Safari?

Jon, you are a madman.

And one has to wonder—where do you find all the time?

Thanks again!
#17

Jon Hicks said 1191 days ago:

#9 – Jordan – The row colours only do up to 10 links – thats as much as I could be bothered doing! Life is too short!

As for this new fangled delicious stuff – its an arse! Someone else can work it out, I’m tired of it now!

Yeah, you can do this with URLid in Firefox, but I didn’t know about Greasemonkey – thanks for the link.

Sorry to the recent Omniweb converts – I’m just keeping you on your toes! In fact, you can do it in Omniweb. There’s a hidden preference for applying a custom css, although it loads the styles for all styles, rather than just the one you’re wanting to theme.

Open Terminal, and type this:
defaults write com.omnigroup.OmniWeb5 OWUserStyleSheetLocation file:///Users/your account/Documents/OWCSS.css
#18

Jordan said 1191 days ago:

Too bad delicious doesn’t use something like div.delPostEven/Odd or even just div.delPost1/2. This is a case where XUL’s even and odd attributes for trees would be really useful…
#19

Chris Winfield said 1190 days ago:

What are the chances that you might weave some CSS magic/jiggery-pokery over the Bloglines site? Call it a challenge if you will. One that only a true master could take on. You never know, with NetNewsWire supporting bloglines now, you might find a use for your efforts.
#20

Dante Evans said 1190 days ago:

That skin for del.icio.us looks really cool (if you’re looking to make del.icio.us more a part of your browser and you use firefox you might be interested in the Del.icio.us search plugin for Firefox ). Is there a skin for Firefox to make it resemble Safari that works on Windows?
#21

Brutal said 1189 days ago:

Wow! That’s just awesome!
#22

Jeff said 1189 days ago:

Not only am I a Firefox user, but a Windows user as well. Needless to say, I am supremely envious. Hope you don’t mind Jon, but I grabbed your del.icio.us CSS and did a little editing so it works with Firefox (provided one has the URIid extension). The css is here as well as instructions if anyone needs it.

Must say Jon, it’s much better than the default interface.
#23

Brutal said 1189 days ago:

btw Jon: When are you going to take a crack at skinning Gmail? ;)
#24

Andreas Graulund said 1187 days ago:

Wow. That looks awesome. Much better than the normal CSS. And it really fits in to the browser. It looks like the Safari RSS feed .
#25

Herschel C said 1187 days ago:

ok, couple things:

1. sure, i’m a n00b, just passing through, but i love your design. don’t hate me cause it’s gorgeous. and i love the comments showing up as a type. you’re good, real good, and i’m …wow. it’s just…wow.

ok, 2. your rss feed for the sidebar links is giving me a parsing error. just thought i’d let you know if you didn’t already.

3. thanks for the safari plug in links! i like firefox, it’s great and all, but as a mac user, safari’s the one for me. i like it’s simplicity and now that it’s got plug ins, i’m one very happy camper. thanks again…
#26

Oyvind said 1186 days ago:

This is great. Del.icio.us never looked this good before!

I downloaded the css file from persistent.info

I used that in PithHelmet to make gmail look good too, but it just didn’t. Any reason this shouldn’t work?
#27

A. Wiseman said 1184 days ago:

Jon, the screenshot looks great, but how do I get the blue bar at the top? When I apply your .phr/css just like you instruct, I get a grey bar at the top? I want that cool Tiger-ish look too!
#28

Jessica Lopez said 1176 days ago:

Damn that thing looks fantastic!
#29

Tibo said 1171 days ago:

Really sweet, Jon… Thank for the tip.
A. Wiseman: Got the same problem originally but upgrading to the latest version of PithHelmet did the trick.

Commenting is closed for this article.

Elsewhere

The Rissington Podcast - weekly shenanigans with Jon Oxton

Hicksmade - unique handmade goods by Leigh Hicks width=

love

Brit Pack: A proud member I love Omniweb Coda Segment Publishing I buy my type from Veer The Forgiveness Project