Bug 1141122: supply a more canonical alternative to about:loopconversation in Loop conversation gUM prompts. r=florian, a=lsblakk
authorMike de Boer <mdeboer@mozilla.com>
Thu, 12 Mar 2015 16:54:33 +0100
changeset 257743 d98504aa80c2f2847ca53e02c477c10dbb7214fd
parent 257742 9b59f3a2743da31da70342679e301e9867f01074
child 257744 8cb4760b0f549e43ba0fd769711621fdd1117fc0
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, lsblakk
bugs1141122
milestone38.0a2
Bug 1141122: supply a more canonical alternative to about:loopconversation in Loop conversation gUM prompts. r=florian, a=lsblakk
browser/modules/webrtcUI.jsm
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -162,18 +162,25 @@ function getHost(uri, href) {
   try {
     if (!uri) {
       uri = Services.io.newURI(href, null, null);
     }
     host = uri.host;
   } catch (ex) {};
   if (!host) {
     if (uri && uri.scheme.toLowerCase() == "about") {
-      // For about URIs, just use the full spec, without any #hash parts
-      host = uri.specIgnoringRef;
+      // Special case-ing Loop/ Hello gUM requests.
+      if (uri.specIgnoringRef == "about:loopconversation") {
+        const kBundleURI = "chrome://browser/locale/loop/loop.properties";
+        let bundle = Services.strings.createBundle(kBundleURI);
+        host = bundle.GetStringFromName("clientShortname2");
+      } else {
+        // For other about URIs, just use the full spec, without any #hash parts.
+        host = uri.specIgnoringRef;
+      }
     } else {
       // This is unfortunate, but we should display *something*...
       const kBundleURI = "chrome://browser/locale/browser.properties";
       let bundle = Services.strings.createBundle(kBundleURI);
       host = bundle.GetStringFromName("getUserMedia.sharingMenuUnknownHost");
     }
   }
   return host;