Bug 118929 - Web Inspector: strings logged to the console cannot be directly copied and pasted into the console as displayed
Summary: Web Inspector: strings logged to the console cannot be directly copied and pa...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Enhancement
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-07-19 16:57 PDT by James Savage
Modified: 2022-02-12 19:25 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Savage 2013-07-19 16:57:52 PDT
Overview:
Evaluating an expression in the web inspector console such as `JSON.stringify({foo:'bar'})`will produce a text result of `"{"foo":"bar"}"`, which if copied and pasted back into the console is a syntax error. It would be useful if we escape inner quote marks, or in some way format this, such that what is displayed is a valid javascript expression.

Steps to reproduce:
Evaluate an expression such as `JSON.stringify({foo:'bar'})`

Expected result:
Console result which is a valid JavaScript expression, such as `"{\"foo\":\"bar\"}"`.

Actual result:
The contents of the result string, wrapped in double quotes, but without inner quotes escaped.
Comment 1 Radar WebKit Bug Importer 2013-07-19 16:58:16 PDT
<rdar://problem/14499707>