Per-site user stylesheets
15th July 2004
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.
More recent articles
- llamafile is the new best way to run a LLM on your own computer - 29th November 2023
- Prompt injection explained, November 2023 edition - 27th November 2023
- I'm on the Newsroom Robots podcast, with thoughts on the OpenAI board - 25th November 2023
- Weeknotes: DevDay, GitHub Universe, OpenAI chaos - 22nd November 2023
- Deciphering clues in a news article to understand how it was reported - 22nd November 2023
- Exploring GPTs: ChatGPT in a trench coat? - 15th November 2023
- Financial sustainability for open source projects at GitHub Universe - 10th November 2023
- ospeak: a CLI tool for speaking text in the terminal via OpenAI - 7th November 2023
- DALL-E 3, GPT4All, PMTiles, sqlite-migrate, datasette-edit-schema - 30th October 2023
- Now add a walrus: Prompt engineering in DALL-E 3 - 26th October 2023