Bug 1404917 - Use request.mimeType instead of request.responseContent.content.mimeType. r=Honza draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 05 Oct 2017 17:42:51 +0200
changeset 675596 e4f84da9e2db9e3dfda3605419f9b208af01edde
parent 674516 c97190c389c4cfef20fe55b4bacade95a36ae6ef
child 675597 a37ae0bc0fb58fccf8b926f73373b89b5064e841
push id83180
push userbmo:poirot.alex@gmail.com
push dateThu, 05 Oct 2017 15:54:09 +0000
reviewersHonza
bugs1404917
milestone58.0a1
Bug 1404917 - Use request.mimeType instead of request.responseContent.content.mimeType. r=Honza MozReview-Commit-ID: EIaS1CFKzVn
devtools/client/netmonitor/src/request-list-context-menu.js
--- a/devtools/client/netmonitor/src/request-list-context-menu.js
+++ b/devtools/client/netmonitor/src/request-list-context-menu.js
@@ -121,18 +121,18 @@ RequestListContextMenu.prototype = {
       click: () => this.copyResponse(),
     });
 
     copySubmenu.push({
       id: "request-list-context-copy-image-as-data-uri",
       label: L10N.getStr("netmonitor.context.copyImageAsDataUri"),
       accesskey: L10N.getStr("netmonitor.context.copyImageAsDataUri.accesskey"),
       visible: !!(selectedRequest &&
-               selectedRequest.responseContent &&
-               selectedRequest.responseContent.content.mimeType.includes("image/")),
+               selectedRequest.mimeType &&
+               selectedRequest.mimeType.includes("image/")),
       click: () => this.copyImageAsDataUri(),
     });
 
     copySubmenu.push({
       type: "separator",
       visible: !!selectedRequest,
     });
 
@@ -159,18 +159,18 @@ RequestListContextMenu.prototype = {
       click: () => this.saveAllAsHar(),
     });
 
     menu.push({
       id: "request-list-context-save-image-as",
       label: L10N.getStr("netmonitor.context.saveImageAs"),
       accesskey: L10N.getStr("netmonitor.context.saveImageAs.accesskey"),
       visible: !!(selectedRequest &&
-               selectedRequest.responseContent &&
-               selectedRequest.responseContent.content.mimeType.includes("image/")),
+               selectedRequest.mimeType &&
+               selectedRequest.mimeType.includes("image/")),
       click: () => this.saveImageAs(),
     });
 
     menu.push({
       type: "separator",
       visible: !!(selectedRequest && !selectedRequest.isCustom),
     });
 
@@ -195,29 +195,29 @@ RequestListContextMenu.prototype = {
       click: () => this.openRequestInTab()
     });
 
     menu.push({
       id: "request-list-context-open-in-debugger",
       label: L10N.getStr("netmonitor.context.openInDebugger"),
       accesskey: L10N.getStr("netmonitor.context.openInDebugger.accesskey"),
       visible: !!(selectedRequest &&
-               selectedRequest.responseContent &&
-               selectedRequest.responseContent.content.mimeType.includes("javascript")),
+               selectedRequest.mimeType &&
+               selectedRequest.mimeType.includes("javascript")),
       click: () => this.openInDebugger()
     });
 
     menu.push({
       id: "request-list-context-open-in-style-editor",
       label: L10N.getStr("netmonitor.context.openInStyleEditor"),
       accesskey: L10N.getStr("netmonitor.context.openInStyleEditor.accesskey"),
       visible: !!(selectedRequest &&
-               selectedRequest.responseContent &&
                Services.prefs.getBoolPref("devtools.styleeditor.enabled") &&
-               selectedRequest.responseContent.content.mimeType.includes("css")),
+               selectedRequest.mimeType &&
+               selectedRequest.mimeType.includes("css")),
       click: () => this.openInStyleEditor()
     });
 
     menu.push({
       id: "request-list-context-perf",
       label: L10N.getStr("netmonitor.context.perfTools"),
       accesskey: L10N.getStr("netmonitor.context.perfTools.accesskey"),
       visible: this.sortedRequests.size > 0,