Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2519)

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js

Issue 2177383003: [Devtools] Added Copy All as cURL to network log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
index 3e8c48459315aeac5e765d59755ca51643fb8c3e..1ee70f261549af531b635e6219fa16a502a93fb4 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -856,6 +856,12 @@ WebInspector.NetworkLogView.prototype = {
} else {
contextMenu.appendItem(WebInspector.UIString("Copy as cURL"), this._copyCurlCommand.bind(this, request, "unix"));
}
+ if (WebInspector.isWin()) {
+ contextMenu.appendItem(WebInspector.UIString("Copy All as cURL (cmd)"), this._copyAllCurlCommand.bind(this, "win"));
lushnikov 2016/07/26 01:23:09 maybe it's time to introduce the "Copy..." submenu
allada 2016/07/26 18:05:45 Done.
+ contextMenu.appendItem(WebInspector.UIString("Copy All as cURL (bash)"), this._copyAllCurlCommand.bind(this, "unix"));
+ } else {
+ contextMenu.appendItem(WebInspector.UIString("Copy All as cURL"), this._copyAllCurlCommand.bind(this, "unix"));
+ }
}
contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^all as HAR"), this._copyAll.bind(this));
@@ -953,6 +959,21 @@ WebInspector.NetworkLogView.prototype = {
InspectorFrontendHost.copyText(this._generateCurlCommand(request, platform));
},
+ /**
+ * @param {string} platform
+ */
+ _copyAllCurlCommand: function(platform)
lushnikov 2016/07/26 01:23:09 let's make a bool argument "useCRLF"
allada 2016/07/26 18:05:45 _generateCurlCommand() needs platform.
+ {
+ var requests = this._nodesByRequestId.valuesArray().map(function(node) { return node.request(); });
lushnikov 2016/07/26 01:23:09 .map(node => node.request());
allada 2016/07/26 18:05:44 Done.
+ var commands = [];
+ for (var request of requests)
+ commands.push(this._generateCurlCommand(request, platform));
+ var newLineChars = "\n";
lushnikov 2016/07/26 01:23:09 var newLine = platform === "win" ? "\r\n" : "\n";
allada 2016/07/26 18:05:45 Done.
+ if (platform === "win")
+ newLineChars = "\r\n";
+ InspectorFrontendHost.copyText(commands.join(" ;" + newLineChars));
+ },
+
_exportAll: function()
{
var filename = WebInspector.targetManager.inspectedPageDomain() + ".har";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698