зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1125621 - Remove https://* restriction from the YouTube MSE check. r=kinetik
This commit is contained in:
Родитель
0f8d322e88
Коммит
ea3d579f8e
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче