Closed Bug 992679 Opened 10 years ago Closed 10 years ago

Context item to open split console and log element

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(relnote-firefox 35+)

RESOLVED FIXED
Firefox 35
Tracking Status
relnote-firefox --- 35+

People

(Reporter: harth, Assigned: beberveiga)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 3 obsolete files)

A handy shortcut for Esc (open split console pane) and evaluating `$0` in the console could be nice, especially since this trick is unknown to many.

It could be a context menu item when you right-click a node in the HTML view. "View in console" or something better than that.
Yeah, a "view in console" right-click menu would be pretty neat.
On the same subject, bug 704094 is about adding a DOM panel to the inspector. I attached a partly working patch to that bug 3 months ago but didn't have time to continue working on it since then.
I think a DOM panel would solve the use case a little bit better, but I also like the right-click menu option.
See Also: → 704094
This is my draft.

Thank you.
Attachment #8473398 - Flags: review?(fayearthur)
Thanks Willian! A few things:

1) "View in console" should be at a higher position in the context menu. I think it should be right under "Copy Image Data" in the first section.

2) Someone just suggested "Show DOM Properties" instead of "View in Console". Interested in your thoughts on this too.

3) We should evaluate "inspect($0)" once the console is opened, not just write it out. This will pop open the variables sidebar.

4) With this patch, sometimes $0 doesn't appear. Sounds like a race condition with opening the console and adding the input.

5) We'll need a test for this.
Attachment #8473398 - Flags: review?(fayearthur)
After hitting hard my head in the wall and with a great help from Heather Arthur on IRC, here is the updated patch. :)
Thank you very much Heather Arthur!
Attachment #8473398 - Attachment is obsolete: true
Attachment #8482456 - Flags: review?(fayearthur)
Comment on attachment 8482456 [details] [diff] [review]
bug-992679-context-item-to-open-split-console-and-log-element-v2.patch

Review of attachment 8482456 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks Willian. Testing this out manually it works great. I got a failure running "./mach mochitest-devtools browser/devtools/inspector". Here's an error I see:

1714 INFO Full message: TypeError: jsterm.focusInput is not a function
1715 INFO Full stack: InspectorPanel_showDOMProperties/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/inspector/inspector-panel.js:748:7

And the next test, browser_inspector_navigation.js times out.

Something we should do is close the split console after we're done testing it. The toolbox I think has a handy method for closing the split console. That might not fix the test, but we should do it anyways.

We'll need to fix that as we can't check it in with failing tests.
Attachment #8482456 - Attachment is obsolete: true
Attachment #8482456 - Flags: review?(fayearthur)
Attachment #8483872 - Flags: review?(fayearthur)
Comment on attachment 8483872 [details] [diff] [review]
bug-992679-context-item-to-open-split-console-and-log-element-v3.patch

Review of attachment 8483872 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me. I pushed to try server so we can make sure the tests pass on all the systems:

https://tbpl.mozilla.org/?tree=Try&rev=d840366b01d4
Attachment #8483872 - Flags: review?(fayearthur) → review+
Attached patch For checkinSplinter Review
Those build errors in the try run are from someone else's bug, verified in #developers.

Thanks a bunch Willian for taking the time to complete this bug, it'll be a useful addition to the tools.

Just added "; r=harth" to the patch.
Attachment #8483872 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/59ad184f8650
Assignee: nobody → contact
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/59ad184f8650
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 35
Release Note Request (optional, but appreciated)
[Why is this notable]: Adds a very wanted feature to the inspector
[Suggested wording]: Show DOM Properties context menu item in inspector
[Links (documentation, blog post, etc)]:
relnote-firefox: --- → ?
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: