The Artima Developer Community
Sponsored Link

Web Buzz Forum
Per-site user stylesheets

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Simon Willison

Posts: 282
Nickname: simonw
Registered: Jun, 2003

Simon Willison is a web technology enthusiast studying for a Computer Science degree at Bath Uni, UK
Per-site user stylesheets Posted: Aug 4, 2005 5:45 PM
Reply to this message Reply

This post originated from an RSS feed registered with Web Buzz by Simon Willison.
Original Post: Per-site user stylesheets
Feed Title: Simon Willison: [X]HTML and CSS
Feed URL: http://simon.incutio.com/syndicate/markup/rss1.0
Feed Description: Simon Willison's [X]HTML and CSS cateory
Latest Web Buzz Posts
Latest Web Buzz Posts by Simon Willison
Latest Posts From Simon Willison: [X]HTML and CSS

Advertisement

I've been thinking a lot about per-site user stylsheets recently. Eric Meyer's CSS signatures are great for sites that support them (as this site does), but the sites that really need altering are highly unlikely to carry them. I posted a comment to that effect on photomatt.net a while ago, and thankfully it was spotted by Ryan Tomayko who has published a simple brilliant hack that uses XBL in Mozilla's user stylesheet to execute JavaScript which adds a CSS signature to every site you visit.

I suggest making a couple of minor modifications to Ryan's code. Firstly, it over-writes any existing body tag IDs which could cause problems on the few sites that use a body ID as a hook for per-page styling. I would recommend not over-writing the ID if it already exists, or adding an additional class to the body element instead. More importantly, Ryan's technique couples your browser's user stylesheet to an XBL file hosted on his server. Not only is this a performance menace (for both his server and potentially your browser) but it opens a cross-site scripting vulnerability in that you are executing code from outside your control every time you visit a web page. I recommend hosting the XBL file locally instead, although the best solution would be to upgrade Ryan's hack to a fully self-contained FireFox extension.

Quibbles aside, it's a brilliant workaround. Be sure to check out the comment from michael on photomatt.net as well.

Read: Per-site user stylesheets

Topic: Librarians' Index to the Internet Previous Topic   Next Topic Topic: WebmasterEdge

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use