ou.jiayong.name

Hi, this is Jiayong Ou's blog about programming and other things he deems interesting.

He's also on Twitter as @jiayongou and short tidbits of his discoveries on the world wide web are on orly.ch. There are also pages for his other online activies, how to get in touch with him, his projects and about his person.

JavaScript Blacklist for Chrome

One of the things I missed since I've switched back from Safari 5 to Google Chrome is Drew Thaler's JavaScript Blacklist extension. It blocks scripts from a configurable list of domains and is useful to get rid of some of the most annoying things on the internet like IntelliTXT (those doubly underlined text link ads).

Since I haven't found an equivalent for Chrome, I wrote it myself, with some code taken from the Safari extension.

Due to limitations in Chrome's extension API, it needs to wait for a message from the background page with the blacklisted domains before it can start filtering <script>-tags. It might be possible that some script files starts to load before the extension kicks in and one of the scripts that gets loaded is on the blacklist. That can't be avoided until there's a way to do message passing synchronously. That issue aside, I'd say the API is rather pleasant to work with. At least the parts that I needed for this extension.

Install & Source Code

You can install it from Chrome extensions gallery. If you're interested in the source code, it's on github. Patches are welcome.

I'm running dev-channel on Mac, but I tested it with the current stable version and it seems to work. I haven't tested it on Linux or Windows, but it should work.

Feedback

Drop me a line or open a bug on github's issue tracker.

Todo

I have no idea of graphics design and the current logo sucks bad. If someone would like to make a decent logo, I'd gladly accept the help.

Also, the settings page could be made a bit prettier.