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 666667 5125dbdcbcb29e3ce48bb5347e1dcd9ceebbad11
parent 666666 e3265d380358d7485a6355c4fb9bd70aa922cba3
child 666668 716be9d0b6e0bacaec3f398693e13f68c6460e52
push id80486
push userbmo:tlin@mozilla.com
push dateTue, 19 Sep 2017 03:52:30 +0000
reviewerscpeterson
bugs1398074
milestone57.0a1
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/"))) {