Safari extension for adding arbitrary Javascript to a page?
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.