RESOLVED FIXED 19874
Inspector should support inspect() in the command line
https://bugs.webkit.org/show_bug.cgi?id=19874
Summary Inspector should support inspect() in the command line
Keishi Hattori
Reported 2008-07-03 06:47:34 PDT
Inspector should support inspect() in the command line for Firebug parity.
Attachments
Patch (4.16 KB, patch)
2009-07-19 05:14 PDT, Keishi Hattori
no flags
Fixed misleading method name (4.16 KB, patch)
2009-07-19 05:17 PDT, Keishi Hattori
no flags
used workaround for DOMStorage (4.21 KB, patch)
2009-07-19 08:48 PDT, Keishi Hattori
timothy: review+
Extra Printout, Can this be removed? (123.15 KB, image/png)
2009-07-19 14:39 PDT, Joseph Pecoraro
no flags
Adam Roben (:aroben)
Comment 1 2008-07-11 14:07:53 PDT
Keishi Hattori
Comment 2 2009-07-19 05:14:12 PDT
Created attachment 33039 [details] Patch 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?
Keishi Hattori
Comment 3 2009-07-19 05:17:59 PDT
Created attachment 33040 [details] Fixed misleading method name
Keishi Hattori
Comment 4 2009-07-19 08:48:59 PDT
Created attachment 33047 [details] used workaround for DOMStorage JoePeck advised me to use a workaround for DOMStorage
Joseph Pecoraro
Comment 5 2009-07-19 14:33:08 PDT
> 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: https://bugs.webkit.org/show_bug.cgi?id=27400 The problem is that this doesn't work properly: inspectedWindow.localStorage === this._domStorage[0]._domStorage Even though they are in fact the same Storage objects, that equivalence test (and also ==) wasn't working for me.
Joseph Pecoraro
Comment 6 2009-07-19 14:39:14 PDT
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?
Joseph Pecoraro
Comment 7 2009-07-19 19:34:51 PDT
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.
Keishi Hattori
Comment 8 2009-07-19 20:55:50 PDT
(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 https://bugs.webkit.org/show_bug.cgi?id=19932 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 https://bugs.webkit.org/show_bug.cgi?id=17907 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.
Timothy Hatcher
Comment 9 2009-07-28 20:45:35 PDT
Can you file bugs about InspectorController.wrapCallback wrapping return results wrong?
Timothy Hatcher
Comment 10 2009-07-28 21:55:47 PDT
Note You need to log in before you can comment on or make changes to this bug.