Safari extension for adding arbitrary Javascript to a page? Is there a way to do this?

I know I can use Stylish for adding arbitrary CSS to pages on a per-domain basis. Looking for something similar to add Javascript.

For example, let's say I wanted to turn the text red for any h1 element on a particular site if the content of that h1 element is "News". Can't do that with CSS, need to do it with Javascript. Is there any extension I can use to add this? Or would I have to write my own?
The dotjs Safari extension sounds like it will do what you want. It injects the JavaScript (from your ~/.js directory) that is served up by a small, local Ruby web server from the original dotjs Chrome extension.