Bug 1125621 - Remove https://* restriction from the YouTube MSE check. r=kinetik a=sledru
authorJet Villegas <bugs@junglecode.net>
Fri, 30 Jan 2015 21:59:35 -0800
changeset 243608 db97d9b88b1a
parent 243607 fff54c008d7d
child 243609 0280782f6bac
push id4414
push userrgiles@mozilla.com
push date2015-02-01 18:59 +0000
treeherdermozilla-beta@db97d9b88b1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik, sledru
bugs1125621
milestone36.0
Bug 1125621 - Remove https://* restriction from the YouTube MSE check. r=kinetik a=sledru
dom/media/mediasource/MediaSource.cpp
--- a/dom/media/mediasource/MediaSource.cpp
+++ b/dom/media/mediasource/MediaSource.cpp
@@ -336,29 +336,24 @@ MediaSource::Enabled(JSContext* cx, JSOb
 
   // Check whether it's enabled everywhere or just YouTube.
   bool restrict = Preferences::GetBool("media.mediasource.youtubeonly", false);
   if (!restrict) {
     return true;
   }
 
   // We want to restrict to YouTube only.
-  // We define that as the origin being https://*.youtube.com.
-  // We also support https://*.youtube-nocookie.com.
+  // We define that as the origin being *.youtube.com.
+  // We also support *.youtube-nocookie.com
   nsIPrincipal* principal = nsContentUtils::ObjectPrincipal(global);
   nsCOMPtr<nsIURI> uri;
   if (NS_FAILED(principal->GetURI(getter_AddRefs(uri))) || !uri) {
     return false;
   }
 
-  bool isHttps = false;
-  if (NS_FAILED(uri->SchemeIs("https", &isHttps)) || !isHttps) {
-    return false;
-  }
-
   nsCOMPtr<nsIEffectiveTLDService> tldServ =
     do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID);
   NS_ENSURE_TRUE(tldServ, false);
 
   nsAutoCString eTLDplusOne;
    if (NS_FAILED(tldServ->GetBaseDomain(uri, 0, eTLDplusOne))) {
      return false;
    }