Over a million developers have joined DZone.

HTML Validator extension for Safari

DZone's Guide to

HTML Validator extension for Safari

· Web Dev Zone ·
Free Resource

Access over 20 APIs and mobile SDKs, up to 250k transactions free with no credit card required

A couple of days ago, Apple announced support for developing extensions, so I felt obliged to implement my HTML Validator extension for Safari too. :-)

The HTML validator extension for Safari

The extension basically offers three options:

Validate URL
Takes the URL of the current tab and opens a new tab with the W3C validator and its validation results for it.

Validate local
Takes the generated HTML of the current web page (especially good for local content) and posts it to the W3C validator. Note: Currently opens the W3C validator in the same tab, since the extension model doesn’t support posting forms/content to new tabs.

If you enable Autorun (on by default) it automatically validates the URL of the current page and displays number of validation errors in the HTML Validator bar.

You can enable extensions and adjust their settings in the extensions view:



Bear in mind that this is a first version and can be a little rough around the edges. However, if you want to try it out, download HTML Validator for Safari from GitHub. Note: it only works in Safari 5.

The Safari extension model

So, it’s interesting to see Safari bet on extensions as well, to be able to compete with other web browser. I’m glad they did, but being Apple, of course they have to do it their way.


The upside of the extension system is that it’s based on HTML, CSS and JavaScript. That’s it. There’s some pretty good descriptive documentation on how to develop extensions and the Safari Extensions Reference is a good overview for properties and methods.

You build/create extensions with the Extension Builder, which I hated at first (since I want a master file I can edit, not a form to fill out), but over time, it is actually quite easy to use instead of over-typing in a pkist file.


Another web browser, another extension model. It is quite similar to the one find in Chrome, but still different. If all web browsers are to start supporting extensions, as developers we must get the same means of developing them. It’s not ok with a different approach for each web browser. And, since Safari are the last ones out (well, ok, not Opera yet), they really should have matched an already existing extension model, for instance, the one found in Google Chrome.

Also, in the Apple spirit, you need to sign up for the Safari Developer program (free) just to be able to develop an extension, and also create certificates with which you sign your extension. Basically, just a lot of hassle. Sure signing is necessary, but there are other ways (see below).

What you can do in the web browser is pretty limited and some obvious features seem to be missing so far (for instance, an event when a tab gains focus).

Also, I can’t believe they start offering extensions without a proper extension web site where people can easily share them. I know such a web site is in the works, and when it’s released it will be much nicer. Also, there you can have automatic extension signing so developers don’t have to care?

And, please, skip the Apple Developer Program bit…


#1 for location developers in quality, price and choice, switch to HERE.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}