New Firefox Extension: X-Ray
// January 6th, 2006 // Web Design Software
One of my “New Year’s resolutions”:http://www.designmeme.com/2005/12/30/new-years-resolutions-for-2006/ was to create an “interesting script, plugin, extension, or widget.” I didn’t think I’d write a Firefox Extension only six days into 2006, but after writing about using the CSS :before and :after pseudo elements to create “CSS Curly Quotes”:http://www.designmeme.com/articles/csscurlyquotes/, it got me thinking about other uses for that technique. I thought that wrapping the elements on a page with the actual tags from the sourcecode might be a good tool for learning and debugging, but wasn’t sure how to go about creating an extension. Fortunately, I found “a great tutorial at roachfiend.com”:http://roachfiend.com/archives/2004/12/08/how-to-create-firefox-extensions/ and with a little trial and error, I’ve finished my first extension.
The “X-Ray Firefox Extension”:http://www.designmeme.com/xray/ let’s you see the tags on a page without viewing the sourcecode.
Install X-Ray Extension for Firefox
One installed the X-Ray command is available by right-clicking as well as in the Tools menu. When applied to a page it can help you see how the document was constructed without having to go back and forth between the sourcecode and the page in your browser. Is that list made of li dd or p elements? Is that an h3 tag or just some bolded text? X-Ray shows you what’s beneath the surface of the page.
While I create webpages all the time, there’s something about writing a piece of code you have to _install_ that’s very satisfying. Even better was finding that it was actually something I’d find helpful myself.
For version 0.5 the current list of supported tags is: h1, h2, h3, h4, h5, h6, p, ol, ul, li, dt, dd, font, div, span, blockquote, pre, a, b, i, strong, em. If some other people find this extension useful, I’ll probably add support for more tags, and possibly experiment with adding some other enhancements as well.
Update
By request from the nice folk at digg.com here’s a screenshot of the extension in use:

Donations to The X-Ray Tip Jar are greatly appreciated.
Thanks for your support!







[...] New Firefox Extension: X-Ray | Design Meme [...]
Two great plugins, good work. thanks
[...] X-Ray Die tags einer Website anzeigen ohne Quellcode. [...]
Please update for Firefox 3 – thank you!
Xray is a very good FF extension but don’t work anymore since FF3. Please Update !
I’ve submitted an updated version of X-Ray to addons.mozilla.org — it should be available anytime now.
I’m really looking forward to that x-ray update! I’ve recently realized how much I depend on it – I use it practically every day.
thanks for the amazing plug-in and thanks for the pending update!!
[...] [2008-07-10]: I just discovered that Stuart has posted a comment at designmeme.com that he actually have submitted an updated version to addons.mozilla.org, but I can’t find [...]
[...] “Xray” | is very useful at the right time Once installed the X-Ray command is available by right-clicking as well as in the Tools menu. When applied to a page it can help you see how the document was constructed without having to go back and forth between the sourcecode and the page in your browser. Is that list made of li dd or p elements? Is that an h3 tag or just some bolded text? X-Ray shows you what’s beneath the surface of the page. The below screen shot shows Xray in action. [...]
Great extension.
Great job, and great tool for webmasters. Thanks!