Chromium Code Reviews| 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"; |