Inspector should support inspect() in the command line for Firebug parity.
Created attachment 33039 [details]
inspect(document.body) jumps to the Elements panel and selects the node in the dom tree
inspect(db) jumps to the Databases panel and selects the database
inspect(window.localStorage) jumps to the Databases panel and selects the domStorage
For other objects, like inspect("foo"), there is no appropriate panel so it fallsback to console.log
Firebug shows "foo" in the DOM tab.
inspect() with no arguments is ignored.
Firebug shows window in the DOM tab.
Is that better?
Created attachment 33040 [details]
Fixed misleading method name
Created attachment 33047 [details]
used workaround for DOMStorage
JoePeck advised me to use a workaround for DOMStorage
> JoePeck advised me to use a workaround for DOMStorage
Yes, this is the same approach I took in the (unreviewed) Live Update DOM Storage Data Grid. If there is a better way, please comment on that bug as well:
The problem is that this doesn't work properly:
inspectedWindow.localStorage === this._domStorage._domStorage
Even though they are in fact the same Storage objects, that equivalence test (and also ==) wasn't working for me.
Created attachment 33057 [details]
Extra Printout, Can this be removed?
There is an extra printout in the Console which is always "undefined". This is the print out of the return value of the inspect() function. Can this printout be removed?
I tried just adding "return o" at the end of the inspectObject function, but the console logs are different then the direct "inspectedWindow.console.log(o)". Any other ideas?
Ahh, this extra printout happens on clear() as well. So it is a problem with both of the functions that are added onto _inspectorCommandLineAPI. So I guess that is an unrelated problem.
(In reply to comment #6)
> Created an attachment (id=33057) [details]
> There is an extra printout in the Console which is always "undefined". This is
> the print out of the return value of the inspect() function. Can this printout
> be removed?
Firebug doesn't print the return value when it's undefined. We discussed it here
I think we decided to keep it at least for now.
> I tried just adding "return o" at the end of the inspectObject function, but
> the console logs are different then the direct
> "inspectedWindow.console.log(o)". Any other ideas?
This is another bug I've encountered before. It's blocking
I've taken a look inside
JSValue JSQuarantinedObjectWrapper::call(ExecState* exec, JSObject* function, JSValue thisValue, const ArgList& args)
It wraps the unwrapped return value with JSInspectedObjectWrapper::wrapOutgoingValue but that's causing this.
If you change it to return the unwrappedResult, it will work as expected. But I don't think this is OK because I suspect the return value should be wrapped for security.
Can you file bugs about InspectorController.wrapCallback wrapping return results wrong?