Bug 151837 - Web Inspector: add "Save Selected" context menu item to Console
Summary: Web Inspector: add "Save Selected" context menu item to Console
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-12-03 16:42 PST by BJ Burg
Modified: 2017-03-16 16:19 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.81 KB, patch)
2017-03-16 15:12 PDT, Devin Rousso
joepeck: review+
Details | Formatted Diff | Diff
[Image] After Patch is applied (71.22 KB, image/png)
2017-03-16 15:12 PDT, Devin Rousso
no flags Details
Patch (3.61 KB, patch)
2017-03-16 15:48 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2015-12-03 16:42:28 PST
Let's face it, most people are going to paste it and save it right away. Might as well make this easier, since it's not much work.
Comment 1 Radar WebKit Bug Importer 2015-12-03 16:42:41 PST
<rdar://problem/23752867>
Comment 2 Devin Rousso 2017-03-16 15:12:17 PDT
Created attachment 304702 [details]
Patch
Comment 3 Devin Rousso 2017-03-16 15:12:34 PDT
Created attachment 304703 [details]
[Image] After Patch is applied
Comment 4 Joseph Pecoraro 2017-03-16 15:28:43 PDT
Comment on attachment 304702 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=304702&action=review

> Source/WebInspectorUI/UserInterface/Base/Main.js:-879
> -    console.assert(saveData.url);
>      console.assert(saveData.content);
> -    if (!saveData.url || !saveData.content)

Rather then allow an empty URL, we can provide a default name.

For saving the entire console we use: "web-inspector:///Console.txt" to prefer a name of "Console.txt".
Here we could use "web-inspector:///ConsoleMessage(s).txt" to get something better than "Untitled"? We could localize if we wanted, but we haven't for other fake URL names.

> Source/WebInspectorUI/UserInterface/Views/LogContentView.js:392
>  

Should we also have a "Save Log" next to the "Clear Log" item for the entire log case?
Comment 5 Joseph Pecoraro 2017-03-16 15:29:25 PDT
Comment on attachment 304702 [details]
Patch

r=me for this as I see no problems with it, just open questions.
Comment 6 Devin Rousso 2017-03-16 15:48:35 PDT
Created attachment 304709 [details]
Patch
Comment 7 WebKit Commit Bot 2017-03-16 16:19:43 PDT
Comment on attachment 304709 [details]
Patch

Clearing flags on attachment: 304709

Committed r214077: <http://trac.webkit.org/changeset/214077>
Comment 8 WebKit Commit Bot 2017-03-16 16:19:48 PDT
All reviewed patches have been landed.  Closing bug.