New issue
Advanced search Search tips

Issue 697149 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

console.table copy/paste to google sheets

Reported by ricky.bl...@teamaol.com, Feb 28 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce the problem:
1. Use console.table to generate a table in dev tools console, e.g.:
function Person(firstName, lastName) {
  this.firstName = firstName;
  this.lastName = lastName;
}
var john = new Person("John", "Smith");
var jane = new Person("Jane", "Doe");
var emily = new Person("Emily", "Jones");
console.table([john, jane, emily]);

2. Select the whole table and copy it.
3. Paste it in a new google sheet.
4. Observe the whole table is condensed in a single cell.

What is the expected behavior?
When pasting into google sheets, the table is preserved by mapping console.table cells into google sheet cells.

What went wrong?
The data copied to the clipboard isn't sufficient for google sheets to know that it's a tabular format.

Did this work before? No 

Chrome version: 56.0.2924.87  Channel: stable
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 24.0 r0

 
Owner: l...@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 2 by l...@chromium.org, Oct 18 2017

Labels: Hotlist-Polish
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80f526543bbe0692624591c0f9ef968fec1d498f

commit 80f526543bbe0692624591c0f9ef968fec1d498f
Author: Erik Luo <luoe@chromium.org>
Date: Sat Nov 18 03:37:31 2017

DevTools: allow copying visible text with styles in console

Console's custom copy handler tries to determine the selected text on
its own. In some cases, the browser's default copy handler offers much
better behavior:
- Include styles and colors
- Include table indentation that can be pasted into spreadsheet editors
- Account for text selections across shadow boundaries

Bug:  673746 ,  697149 ,  649828 
Change-Id: I4b5e3a225234e28fe84197a73f655af9c4c9f418
Reviewed-on: https://chromium-review.googlesource.com/773462
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517691}
[modify] https://crrev.com/80f526543bbe0692624591c0f9ef968fec1d498f/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
[modify] https://crrev.com/80f526543bbe0692624591c0f9ef968fec1d498f/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js

Comment 4 by l...@chromium.org, Nov 18 2017

Status: Fixed (was: Assigned)
To update this bug: we can offer a partial solution for now, in which users "Copy visible styled text" from the right-click context menu to achieve this functionality.  Performing this right click action should allow you to copy and paste the visible selection of a console.table() message.

While a right click option is not as ideal as I'd like, I'm marking this as fixed, since there are no plans in which we could support this without incurring significant complexity.

Comment 5 by benjamin...@gmail.com, Jan 18 (5 days ago)

I don't see that option in my right-click context menu. (OSX)

It seems like that what is missing is the tab character / newline character when copying from the table, then sheets would be able to parse it.  (Like a copy from Google sheets into a plain text editor)

As it stands now, I can't even paste into plain-text, it joins all the cells into one huge block.

This seems to be different than copying from a HTML table.

Comment 6 by l...@chromium.org, Jan 18 (5 days ago)

c#5: it looks like there's a bug with tables in Console, such that context menus are missing the normal console items (console.clear as well).  I've filed a separate bug: issue 923463

Thank you for discovering this.

Sign in to add a comment