Bug 1260304 - Remove mediasource string from context menu on Android. r=margaret
authorRay Lin <ralin@mozilla.com>
Mon, 18 Apr 2016 15:26:21 +0800
changeset 322202 49b7c8123960f0b443aeb8df0c795bbebbd39042
parent 322201 731fde2902c9b0c9db9fba2bec23b4439ce2da7c
child 322203 582c4b721a4f67b8b93f793ef35349e65db80382
push id9671
push userraliiev@mozilla.com
push dateMon, 06 Jun 2016 20:27:52 +0000
treeherdermozilla-aurora@cea65ca3d0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1260304
milestone49.0a1
Bug 1260304 - Remove mediasource string from context menu on Android. r=margaret MozReview-Commit-ID: 5BdIUzgkTV
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -2703,17 +2703,19 @@ var NativeWindow = {
       } else if (node instanceof Ci.nsIImageLoadingContent && node.currentURI) {
         // The image is blocked by Tap-to-load Images
         let originalURL = node.getAttribute("data-ctv-src");
         if (originalURL) {
           return originalURL;
         }
         return node.currentURI.spec;
       } else if (node instanceof Ci.nsIDOMHTMLMediaElement) {
-        return (node.currentSrc || node.src);
+        let srcUrl = node.currentSrc || node.src;
+        // If URL prepended with blob or mediasource, we'll remove it.
+        return srcUrl.replace(/^(?:blob|mediasource):/, '');
       }
 
       return "";
     },
 
     // Adds an array of menuitems to the current list of items to show, in the correct context
     _addMenuItems: function(items, context) {
         if (!this.menus[context]) {