Bug 1141122: supply a more canonical alternative to about:loopconversation in Loop conversation gUM prompts. r=florian
authorMike de Boer <mdeboer@mozilla.com>
Thu, 12 Mar 2015 16:54:33 +0100
changeset 250118 912179142d7efdb81dd3527c0eeb0b0ba9806b49
parent 250117 95407a27036794d0cd9e83011f3b2dffc007da21
child 250119 3e784015e7aaa154aeae0c3f8d746ea298caf77b
push id1010
push usermleibovic@mozilla.com
push dateThu, 12 Mar 2015 18:26:20 +0000
reviewersflorian
bugs1141122
milestone39.0a1
Bug 1141122: supply a more canonical alternative to about:loopconversation in Loop conversation gUM prompts. r=florian
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;