Bug 1125621 - Remove https://* restriction from the YouTube MSE check. r=kinetik a=sledru
--- 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;
}