RESOLVED FIXED 16396
Cannot select text in the Inspector DOM tree to copy
https://bugs.webkit.org/show_bug.cgi?id=16396
Summary Cannot select text in the Inspector DOM tree to copy
Gavin Sherlock
Reported 2007-12-10 23:12:17 PST
When viewing source code in the Inspector window, sometimes you would like to copy some of it. Currently this functionality does not exists. Tested with r28586.
Attachments
Gavin Sherlock
Comment 1 2007-12-11 23:31:41 PST
I just realized that you can copy the code in Source view, whereas I was looking in DOM view in the Inspector. Thus closing as WORKSFORME
David Kilzer (:ddkilzer)
Comment 2 2007-12-12 06:37:08 PST
I've tried copying HTML from the DOM view before and been frustrated. You shouldn't have to switch to the source view (and loose your place) just to copy HTML. Also, the source view will differ from the DOM view if the DOM has changed since loading the page. Reopening and retitling bug.
David Kilzer (:ddkilzer)
Comment 3 2007-12-12 07:00:01 PST
For example, this would be really handy for reducing Bug 16403.
Adam Roben (:aroben)
Comment 4 2007-12-12 08:09:07 PST
(In reply to comment #2) > I've tried copying HTML from the DOM view before and been frustrated. You > shouldn't have to switch to the source view (and loose your place) just to copy > HTML. Also, the source view will differ from the DOM view if the DOM has > changed since loading the page. > > Reopening and retitling bug. Is this not a dup of bug 12054?
David Kilzer (:ddkilzer)
Comment 5 2007-12-14 07:44:19 PST
(In reply to comment #4) > Is this not a dup of bug 12054? I can't get it to work as expected. Do I click on the breadcrumb at the bottom of the window to copy the HTML, or an item in the DOM tree itself?
Adam Roben (:aroben)
Comment 6 2007-12-14 10:29:45 PST
(In reply to comment #5) > (In reply to comment #4) > > Is this not a dup of bug 12054? > > I can't get it to work as expected. Do I click on the breadcrumb at the bottom > of the window to copy the HTML, or an item in the DOM tree itself? Tim might know.
Timothy Hatcher
Comment 7 2007-12-14 10:54:15 PST
Clicking an item in the DOM tree or breadcrumb then typing Command-C will copy it. Are you copying with the context menu or the keyboard command? You might be hitting bug 16439.
Gavin Sherlock
Comment 8 2007-12-14 10:58:40 PST
I was trying to simply select text in the DOM using the cursor, which I would then copy using the keyboard, but you cannot do this except for an entire DOM node. You cannot select specific text at all using the cursor.
David Kilzer (:ddkilzer)
Comment 9 2007-12-14 11:04:29 PST
(In reply to comment #7) > Clicking an item in the DOM tree or breadcrumb then typing Command-C will copy > it. > > Are you copying with the context menu or the keyboard command? You might be > hitting bug 16439. Yes, I was using the contextual menu in the DOM view, not the breadcrumbs. If we were to allow selections in the DOM view (as in Comment #8), there should be a way to expand all nodes under a given node (or the copy operation should just magically pick them up without being expanded, IMO). Right now, I'm using a JavaScript alert dialog to get the current DOM for a page, e.g.: 1. Load page. 2. Type in URL: javascript:alert(document.documentElement.outerHTML) 3. Hit Enter 4. Click in alert sheet. 5. Hit Cmd-A to select all. 6. Hit Cmd-C to copy the HTML. 7. Click "Okay" to dismiss the alert sheet. 8. Paste your HTML somewhere useful.
Timothy Hatcher
Comment 10 2007-12-14 11:11:47 PST
Well the fix for bug 12054 allows copying the currently selected node (outerHTML) with Command-C. Copying with the context menu is broken and is tracked with bug 16439. We can use this bug to track allowing copying with a selection in the DOM tree.
Adam Roben (:aroben)
Comment 11 2008-01-29 11:07:43 PST
Pavel Feldman
Comment 12 2010-01-04 02:55:14 PST
Elements Panel provides structural view of the DOM. One can only select nodes there. For each selected node, 'Copy as HTML' action is available via shortcut, context menu or main menu item. It will put HTML markup (outerHTML) for that node into clipboard as text. You can also invoke Edit as HTML from context menu and copy parts of the text into clipboard.
Note You need to log in before you can comment on or make changes to this bug.