Summary: | Inspector should support inspect() in the command line | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Keishi Hattori <keishi> | ||||||||||
Component: | Web Inspector (Deprecated) | Assignee: | Nobody <webkit-unassigned> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Enhancement | CC: | aroben, joepeck, rik, timothy | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | All | ||||||||||||
OS: | All | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 14355 | ||||||||||||
Attachments: |
|
Description
Keishi Hattori
2008-07-03 06:47:34 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?
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: 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. 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 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. Can you file bugs about InspectorController.wrapCallback wrapping return results wrong? |