Closed Bug 1523022 Opened 6 years ago Closed 6 years ago

Backtraces in Browser Console aren't usefully copypastable (there are no newlines between backtrace levels, so it all just ends on on one giant line)

Categories

(DevTools :: Console, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 1486870

People

(Reporter: dholbert, Unassigned)

Details

STR:

  1. Ctrl+Shift+J to open the Browser Console.

  2. Do something that triggers a JS error (red highlighted entry) with a collapsible/uncollapsible backtrace in the Browser Console. (i.e. a little triangle icon that can be clicked to show/hide the backtrace).
    For example, you could perform bug 1523020's STR in current Nightly -- the first three errors shown in the screenshot there are the type of error that I'm concerned with here:
    https://bug1523020.bmoattachments.org/attachment.cgi?id=9039272

  3. Click the triangle icon to expand the backtrace (so it's visible as in that^^ screenshot)

  4. Try to copy & paste the backtrace into a bug comment field or into a text editor.

EXPECTED RESULTS:
The backtrace should paste in as a multi-line text expression, with a newline character at the end of each backtrace level.

ACTUAL RESULTS:
The backtrace is pasted in all on a single line, with no newline characters, even though it showed up as a nicely formatted multi-line thing in the Browser Console.

This makes it pretty annoying when trying to post a backtrace into a bug report, for example. (I was going to do this on bug 1523020 but ended up posting a screenshot instead because the formatting was broken enough to make it unreadable if I copypasted.)

E.g. if I try to paste in the first error from that screenshot (including its backtrace) into this bug comment, here's what the pasted output looks like:

Error while calling actor 'parentProcessTarget's method 'ensureCSSErrorReportingEnabled' Argument 1 of InspectorUtils.getAllStyleSheets is not an object.
protocol.js:1048:5

writeError resource://devtools/shared/protocol.js:1048 handler resource://devtools/shared/protocol.js:1243 handler resource://devtools/shared/protocol.js:1243 _queueResponse resource://devtools/shared/protocol.js:1062 handler resource://devtools/shared/protocol.js:1242 onPacket resource://devtools/server/main.js:1279 send resource://devtools/shared/transport/local-transport.js:64 makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:109 makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:109 
Summary: Bascktraces in Browser Console aren't usefully copypastable (there are no newlines between backtrace levels) → Backtraces in Browser Console aren't usefully copypastable (there are no newlines between backtrace levels, so it all just ends on on one giant line)

Daniel, can you test it again after updating to latest central?
We landed a fix for that in Bug 1486870, and here's what I get when I copy the message + stacktrace and copy it here:

Error while calling actor 'parentProcessTarget's method 'ensureCSSErrorReportingEnabled' Argument 1 of InspectorUtils.getAllStyleSheets is not an object. protocol.js:1048:5
    writeError resource://devtools/shared/protocol.js:1048
    handler resource://devtools/shared/protocol.js:1243

I'm setting this bug as duplicate, but don't hesitate to reopen it if you still see the issue. Thanks!

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE

Yeah, this seems to be fixed in today's nightly. Thanks!

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.