Index: Source/devtools/front_end/ImageView.js |
diff --git a/Source/devtools/front_end/ImageView.js b/Source/devtools/front_end/ImageView.js |
index f5cb0dc1efe75905d4de42e08ac9a8ca354b72bb..bf79de76486fe8ccc283d1ad1bf3522e6652a04d 100644 |
--- a/Source/devtools/front_end/ImageView.js |
+++ b/Source/devtools/front_end/ImageView.js |
@@ -110,6 +110,7 @@ WebInspector.ImageView.prototype = { |
this._container.appendChild(infoListElement); |
} |
imagePreviewElement.addEventListener("load", onImageLoad.bind(this), false); |
+ this._imagePreviewElement = imagePreviewElement; |
}, |
_base64ToSize: function(content) |
@@ -128,10 +129,17 @@ WebInspector.ImageView.prototype = { |
{ |
var contextMenu = new WebInspector.ContextMenu(event); |
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy image URL" : "Copy Image URL"), this._copyImageURL.bind(this)); |
+ if (this._imagePreviewElement.src) |
+ contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy image as Data URL" : "Copy Image As Data URL"), this._copyImageAsDataURL.bind(this)); |
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Open image in new tab" : "Open Image in New Tab"), this._openInNewTab.bind(this)); |
contextMenu.show(); |
}, |
+ _copyImageAsDataURL: function() |
+ { |
+ InspectorFrontendHost.copyText(this._imagePreviewElement.src); |
+ }, |
+ |
_copyImageURL: function() |
{ |
InspectorFrontendHost.copyText(this.resource.url); |