Release a Cocoa App Friday: Safari Guide 1.2
Announcing Version 1.2 of Safari Guide, my Cocoa developer tool for evaluating XPath, XQuery, and JavaScript expressions against a webpage or document in the frontmost Safari window. Safari Guide requires Mac OS X 10.4 or later.
Download Safari Guide 1.2 (104kb)
New in this version:
- JavaScript! — Now you can also evaluate JavaScript expressions against the frontmost Safari window.
- Safari Guide is now a multi-window application… you can have multiple Safari Guide controller windows open simultaneously.
- Safari Guide now makes heavy use of Cocoa Bindings… but you don’t really care about that as a user!
Safari Guide is a convenient way to run XPath, XQuery, and JavaScript expressions against your webpage or XML document… just open your document in a Safari window, switch to Safari Guide and type your expression into the appropriate text field. Click ‘Evaluate’ and watch the sequence of matching nodes or JavaScript result appear.
Now with JavaScript, you can not only query the frontmost Safari Window, but alter its contents and attributes. The JavaScript expression you evaluate against the window can cause live changes to that window.
For example, you can type:
document.title = 'yo dude';
or
document.documentElement.innerHTML = '<strong>hi</strong>';
And click ‘Evaluate’. Now check out the front window… cool huh? Use Safari Guide to try out JavaScript DOM algorithms too.
Safari Guide is based on two of Apple’s Objective-C frameworks:
- NSXML, the all-purpose (DOM, XPath, XQuery, XSL) XML library.
- WebKit, the web rendering engine that powers the Safari web browser.
Why Safari Guide?
I’ve long had a fascination with XPath and XQuery, and wanted to learn more about these languages… but until now, I have lacked a simple, elegant tool with which to explore their syntax.
Safari Guide can help you debug XPath- or XQuery-based applications (because there are so many of those lying around
), or it can just help you tinker around with XPath or XQuery — which are deep and interesting languages.
Happy Developing.

