WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 45662
Web Inspector: [Resources panel] Should be easy to copy data.
https://bugs.webkit.org/show_bug.cgi?id=45662
Summary
Web Inspector: [Resources panel] Should be easy to copy data.
Pavel Feldman
Reported
2010-09-13 06:07:03 PDT
In Firebug, when you right-click a URL, you get a context menu with options to copy the location, copy the request headers, or copy the response headers. HttpWatch is even better--it has separate panels for headers, cookies, query string, and postdata. You can go to any panel, and see the data split into a table of name/value pairs. Right click on any value and you get the option to copy the value, the name/value pair, or all the rows in the panel. This is extremely useful when someone asks you to send them the value of a certain header or post field, which happens to me a lot.
Attachments
Patch
(4.36 KB, patch)
2011-04-15 17:39 PDT
,
Annie Sullivan
pfeldman
: review-
Details
Formatted Diff
Diff
Patch: Addresses comments and adds localized strings.
(4.65 KB, patch)
2011-04-21 18:30 PDT
,
Annie Sullivan
pfeldman
: review-
pfeldman
: commit-queue-
Details
Formatted Diff
Diff
New patch, merged with tip of tree
(4.65 KB, patch)
2011-04-22 11:48 PDT
,
Annie Sullivan
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Annie Sullivan
Comment 1
2011-04-15 17:39:57 PDT
Created
attachment 89893
[details]
Patch To get the request/response headers as plain text, I implemented get requestHeadersText() and get responseHeadersText() for WebInspector.Resource, similar to the getters for sorted headers. Let me know if there's a better way to do this.
Yury Semikhatsky
Comment 2
2011-04-18 01:28:00 PDT
Comment on
attachment 89893
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=89893&action=review
> Source/WebCore/inspector/front-end/NetworkPanel.js:1003 > + contextMenu.appendItem(WebInspector.UIString("Copy request headers"), this._exportRequestHeaders.bind(this, resource));
New UI strings should be added to Source/WebCore/English.lproj/localizedStrings.js.
Pavel Feldman
Comment 3
2011-04-18 02:18:31 PDT
Comment on
attachment 89893
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=89893&action=review
Overall looks good. You need an entry in localizedStrings.js as Yury suggests to land this.
> Source/WebCore/inspector/front-end/NetworkPanel.js:1023 > InspectorFrontendHost.copyText(JSON.stringify(har));
It used to export values, now it copies them, so the name of the method is misleading. Do not reuse it.
> Source/WebCore/inspector/front-end/NetworkPanel.js:1026 > + _exportLocation: function(resource)
I.e. should be _copyLocation, etc.
> Source/WebCore/inspector/front-end/Resource.js:429 > + this._requestHeadersText += key + ": " + this.requestHeaders[key] + '\n';
Please use double quotes.
> Source/WebCore/inspector/front-end/Resource.js:510 > + this._responseHeadersText += key + ": " + this.responseHeaders[key] + '\n';
ditto.
Annie Sullivan
Comment 4
2011-04-21 18:28:56 PDT
Comment on
attachment 89893
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=89893&action=review
>> Source/WebCore/inspector/front-end/NetworkPanel.js:1023 >> InspectorFrontendHost.copyText(JSON.stringify(har)); > > It used to export values, now it copies them, so the name of the method is misleading. Do not reuse it.
Done.
>> Source/WebCore/inspector/front-end/NetworkPanel.js:1026 >> + _exportLocation: function(resource) > > I.e. should be _copyLocation, etc.
Done.
>> Source/WebCore/inspector/front-end/Resource.js:429 >> + this._requestHeadersText += key + ": " + this.requestHeaders[key] + '\n'; > > Please use double quotes.
Done.
>> Source/WebCore/inspector/front-end/Resource.js:510 >> + this._responseHeadersText += key + ": " + this.responseHeaders[key] + '\n'; > > ditto.
Done.
Annie Sullivan
Comment 5
2011-04-21 18:30:16 PDT
Created
attachment 90647
[details]
Patch: Addresses comments and adds localized strings.
Pavel Feldman
Comment 6
2011-04-22 02:07:22 PDT
Comment on
attachment 90647
[details]
Patch: Addresses comments and adds localized strings. I think you need to merge this code with the tip of the tree. Also, note that there is a way to copy headers via switching to raw view + selecting + copypasting.
Annie Sullivan
Comment 7
2011-04-22 11:48:38 PDT
Created
attachment 90734
[details]
New patch, merged with tip of tree
Annie Sullivan
Comment 8
2011-04-22 11:55:49 PDT
(In reply to
comment #6
)
> (From update of
attachment 90647
[details]
) > I think you need to merge this code with the tip of the tree. Also, note that there is a way to copy headers via switching to raw view + selecting + copypasting.
Yes, it's possible to do this, but it's really hard to get all the headers without truncating something from the top or bottom or accidentally including some of the text above/below the headers, especially on a laptop with a smaller screen and no mouse. I think this is why both Firebug and HttpWatch provide context menu options for this. It's a very useful feature for quickly getting information into a bug or email.
Pavel Feldman
Comment 9
2011-04-25 09:39:19 PDT
Comment on
attachment 90734
[details]
New patch, merged with tip of tree Clearing flags on attachment: 90734 Committed
r84778
: <
http://trac.webkit.org/changeset/84778
>
Pavel Feldman
Comment 10
2011-04-25 09:39:28 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug