Closed Bug 1298359 Opened 8 years ago Closed 8 years ago

unable to copy HTML selector

Categories

(DevTools :: Inspector, defect)

48 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 987877

People

(Reporter: jidanni, Unassigned)

References

Details

Attachments

(1 file)

User sees HTML selector (or whatever it is called. I have circled it in red.)

User wishes to copy it.

User has no way to copy it.

There it is, sitting right in front of the user (html > body > div#...) . He cannot copy it.

The best he can do is copy the CSS selector. But that is not the same!
I understand the frustration from being unable to copy something visible, but I would first like to understand why you want to use this instead of the CSS selector.

The CSS selector will be a reliable unique selector that can be used to identify the element.
The path shown in the breadcrumbs is just an indication, but does not map uniquely to the targeted element.

For instance if you open 
> data:text/html,<div><div class=sub><div>el1</div></div><div class=sub><div>el2</div></div><div class=sub><div>el3</div></div></div>

Whether you select el1, el2 or el3, the path displayed in the breadcrumbs will remain the same.
Flags: needinfo?(jidanni)
All I know is lately I've been using Perl to zero in on certain items
within an HTML document,

          XML::TreePP->new( use_ixhash => 1, xml_decl => '', indent => 2 );
        for my $I (
            @{
                $tpp->parse($R1)->{html}->{body}->{main}->{div}[0]->{div}[1]
                  ->{div}->{div}
            }
          )...
and would like a way to get the paths to a certain element...
Sort of like "please tell me the Basex xpath to what I'm clicking on."
Flags: needinfo?(jidanni)
Right so you actually want the xpath of the node, which is not really what the breadcrumbs display. 

This could be an option in the "Copy" submenu of the context menu when you click on a node, would that do? 
Looks like there is already Bug 987877 logged for this, although there hasn't been much activity on the bug lately.
See Also: → 987877
Yes!
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
But wait: also allow copying that thing I circled in red, which is somewhat different from the xpath, in case somebody wants it too someday (and thus is sitting in front of something he cannot copy!)
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: