Bug 1398074 - Add youtube-nocookie.com to domain list for HTML5 rewrites; r=cpeterson
authorKyle Machulis <kyle@nonpolynomial.com>
Fri, 08 Sep 2017 13:02:22 -0700
changeset 381498 5125dbdcbcb29e3ce48bb5347e1dcd9ceebbad11
parent 381497 e3265d380358d7485a6355c4fb9bd70aa922cba3
child 381499 716be9d0b6e0bacaec3f398693e13f68c6460e52
push id51484
push userkmachulis@mozilla.com
push dateMon, 18 Sep 2017 19:38:27 +0000
treeherderautoland@5125dbdcbcb2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpeterson
bugs1398074
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1398074 - Add youtube-nocookie.com to domain list for HTML5 rewrites; r=cpeterson MozReview-Commit-ID: Dc1gZTMu5O4
dom/base/nsObjectLoadingContent.cpp
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1380,17 +1380,18 @@ nsObjectLoadingContent::MaybeRewriteYout
   bool ok = NS_SUCCEEDED(tldService->GetBaseDomain(aURI, 0, currentBaseDomain));
   if (!ok) {
     // Data URIs (commonly used for things like svg embeds) won't parse
     // correctly, so just fail silently here.
     return;
   }
 
   // See if URL is referencing youtube
-  if (!currentBaseDomain.EqualsLiteral("youtube.com")) {
+  if (!currentBaseDomain.EqualsLiteral("youtube.com") &&
+      !currentBaseDomain.EqualsLiteral("youtube-nocookie.com")) {
     return;
   }
 
   // We should only rewrite URLs with paths starting with "/v/", as we shouldn't
   // touch object nodes with "/embed/" urls that already do that right thing.
   nsAutoCString path;
   aURI->GetPathQueryRef(path);
   if (!StringBeginsWith(path, NS_LITERAL_CSTRING("/v/"))) {