Context item to open split console and log element

RESOLVED FIXED in Firefox 35

Status

defect
RESOLVED FIXED
5 years ago
10 months ago

People

(Reporter: harth, Assigned: beberveiga)

Tracking

(Blocks 1 bug)

unspecified
Firefox 35

Firefox Tracking Flags

(relnote-firefox 35+)

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Reporter)

Description

5 years ago
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
(Assignee)

Comment 2

5 years ago
This is my draft.

Thank you.
Attachment #8473398 - Flags: review?(fayearthur)
(Reporter)

Comment 3

5 years ago
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.
(Reporter)

Updated

5 years ago
Attachment #8473398 - Flags: review?(fayearthur)
(Assignee)

Comment 4

5 years ago
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)
(Reporter)

Comment 5

5 years ago
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.
(Assignee)

Comment 6

5 years ago
Attachment #8482456 - Attachment is obsolete: true
Attachment #8482456 - Flags: review?(fayearthur)
Attachment #8483872 - Flags: review?(fayearthur)
(Reporter)

Comment 7

5 years ago
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+
(Reporter)

Comment 8

5 years ago
Posted 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
(Reporter)

Updated

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 35

Comment 11

5 years ago
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: --- → ?

Updated

10 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.