Bug 730941 - Add "view image" to context menu. r=wesj
☠☠ backed out by d26a2463dc6b ☠ ☠
authorAnuj Sahai <sahai.anuj16@gmail.com>
Tue, 15 Apr 2014 00:25:47 +0530
changeset 198500 882b5ddfc023fd9518c87f33e8ea19bfce5f85f9
parent 198499 07aed296db2a0224847dbd1dd1c3bf8de2ba06b3
child 198501 bb54e487c53ed820ab0a128ef30a1bf34bbc4a9c
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs730941
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 730941 - Add "view image" to context menu. r=wesj
mobile/android/chrome/content/browser.js
mobile/android/locales/en-US/chrome/browser.properties
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -647,16 +647,25 @@ var BrowserApp = {
       });
 
     NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.unmute"),
       NativeWindow.contextmenus.mediaContext("media-muted"),
       function(aTarget) {
         aTarget.muted = false;
       });
 
+    NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.viewImage"),
+      NativeWindow.contextmenus.imageLocationCopyableContext,
+      function(aTarget) {
+        let url = aTarget.src;
+        ContentAreaUtils.urlSecurityCheck(url, aTarget.ownerDocument.nodePrincipal,
+                                          Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
+        BrowserApp.loadURI(url);
+      });
+
     NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.copyImageLocation"),
       NativeWindow.contextmenus.imageLocationCopyableContext,
       function(aTarget) {
         let url = aTarget.src;
         NativeWindow.contextmenus._copyStringToDefaultClipboard(url);
       });
 
     NativeWindow.contextmenus.add({
--- a/mobile/android/locales/en-US/chrome/browser.properties
+++ b/mobile/android/locales/en-US/chrome/browser.properties
@@ -169,16 +169,17 @@ contextmenu.copyLink=Copy Link
 contextmenu.shareLink=Share Link
 contextmenu.bookmarkLink=Bookmark Link
 contextmenu.copyEmailAddress=Copy Email Address
 contextmenu.shareEmailAddress=Share Email Address
 contextmenu.copyPhoneNumber=Copy Phone Number
 contextmenu.sharePhoneNumber=Share Phone Number
 contextmenu.changeInputMethod=Select Input Method
 contextmenu.fullScreen=Full Screen
+contextmenu.viewImage=View Image
 contextmenu.copyImageLocation=Copy Image Location
 contextmenu.shareImage=Share Image
 # LOCALIZATION NOTE (contextmenu.search):
 # The label of the contextmenu item which allows you to search with your default search engine for
 # the text you have selected. %S is the name of the search engine. For example, "Google".
 contextmenu.search=%S Search
 contextmenu.saveImage=Save Image
 contextmenu.setImageAs=Set Image As