Bug 1125621 - Remove https://* restriction from the YouTube MSE check. r=kinetik

This commit is contained in:
Jet Villegas 2015-01-30 21:59:35 -08:00
Родитель 0f8d322e88
Коммит ea3d579f8e
1 изменённых файлов: 2 добавлений и 7 удалений

Просмотреть файл

@ -341,19 +341,14 @@ MediaSource::Enabled(JSContext* cx, JSObject* aGlobal)
}
// 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);