After having Firefox (FireBug) crash for the 30th time during debugging (I'm on Ubuntu), I decided to use Chrome. For the most part, it's great. I've just one big issue. In FireBug when you logged something to the console you always get the string representation of the object. As a result it made good sense to implement toString on most of your prototypes allowing for the most important information to be displayed anytime an object appeared anywhere in the developer panels or console.
If my code logs the following:
console.log(bill_gates);
I don't want the first representation of my object in the console to be:
Object
when it could be:
Person{Bill Gates, Microsoft Founder, dob: Oct 28}
And I shouldn't have to double log everything to compensate for this shortcoming:
console.log(bill_gates, bill_gates.toString());
Besides double-logging doesn't help when you drill down into an object and find that your object is composed of other objects that are all labelled "Object".
Imagine going to a party where everyone's name badge says "Person". What I want is a little more detail about that person's identity, perhaps "Ned Campbell, Realtor" or "Sue Bradshaw, Insurance Sales". In FireBug, your objects wear custom name badges (based on your toString implementation). In Chrome, all your objects wear name badges that say "Object". You have to spend time interrogating the object (drilling down into its properties and methods) to figure out what object you're dealing with. What a waste.
This to me is a MAJOR oversight in the design of the otherwise superb Chrome Devtools. Is there some way (an extension maybe) to make the Devtools show string representations of objects (wherever they appear) as FireBug does?
Regarding the second part of your question: yes, there is a bug filed against Web Inspector (in the WebKit bugzilla.) Feel free to CC yourself on it (once you have registered there.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With