HTML Validator extension for Safari
Join the DZone community and get the full member experience.
Join For Free
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.
- autorun
-
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:
download
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.
pros
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.
cons
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…
Published at DZone with permission of Robert Nyman, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments