0

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?

1

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.

0

I previously used dotjs and dotcss for Safari. As I relied on these a lot, I've written an extension for Safari 12 that provides the same functionality in one extension with a simpler setup.

In case you're interested, I have an introductory blog post. The extension is available on the App Store ($5). It's open source, so you're also welcome to compile it yourself for free.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .