Hi, my name is Timo Ernst and I am a web expert.

Posts Tagged ‘Mozilla’

Object inspector for JavaScript

Posted on: December 21st, 2009 by Timo

Sometimes, one cannot inspect JavaScript-objects using an external debugger, like Firebug.

For example, this can happen during development of Firefox addons: Open the JavaScript inspector of Firebug and you will only see the JavaScript errors on the currently displayed website, but not the ones from the addon.

Thus, I modified the inspect()-function from Ariel Tapia (codeprojects.com) a bit. My version will not only return a HTML string with all the attributes and functions that are inside the object. It will also add the values of these.

Installation: Just unzip the file and include it via
<script src="inspector.js" type="text/javascript"></script>
(As an alternative, you can also just copy and paste the function directly into your source.)

Example usage: var htmlResult = inspect(myObject, null, null);
htmlResult will now hold a string-representation of the properties and functions of myObject.

Note: An alternative for Firefox addons is Venkman. Haven’t really figured out how to use that though.
So, if you don’t want to bother with Venkman or need an object-inspector for any other purpose, I think you’ll be fine with my function provided above.

TwitterDiggFacebookShare

Mozilla guys are real geeks

Posted on: December 21st, 2009 by Timo

I am currently playing around a bit with Firefox addons.
To create a GUI for such extensions you need XUL, a XML-based markup language.

Now, check out the namespace for XUL:
http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul

Don’t get it? Fool! Go watch Ghostbusters I again! (Man, this reminds me of me being a kid and watching this movie over and over again).

However, now guess how a Firefox addon is called for debugging JavaScript in such extensions. Right: Venkman

TwitterDiggFacebookShare