After crashing Firefox (FireBug) for the 30th time during debugging (I'm on Ubuntu), I decided to use Chrome. For the most part, this is great. I have only one big problem. In FireBug, when you wrote something to the console, you always get a string representation of the object. As a result, it was wise to implement toString on most of your prototypes, allowing you to display the most important information at any time when the object appeared anywhere in the developer’s or console panels.
If my code registers the following:
console.log(bill_gates);
I do not want the first view of my object in the console to be as follows:
Object
when it's possible:
Person{Bill Gates, Microsoft Founder, dob: Oct 28}
And I don’t have to write everything down twice to make up for this flaw:
console.log(bill_gates, bill_gates.toString());
In addition, double-logging does not help when you navigate to an object and find that your object consists of other objects, all of which are marked as “Object”.
Imagine going to a party where each name icon says “Man.” I want a little more about this person, perhaps Ned Campbell, Realtor or Sue Bradshaw, Insurance Sales. In FireBug, your objects carry custom name icons (based on your implementation of toString). In Chrome, all of your objects carry name badges that say “Object.” You must spend time interrogating the object (drilling its properties and methods) to find out which object you are dealing with. What a waste.
This is for me the main control over the design of the great Chrome Devtools. Is there a way (possibly an extension) for Devtools to display string representations of objects (wherever they appear) like FireBug?