Bug 1398074 - Add youtube-nocookie.com to domain list for HTML5 rewrites; r=cpeterson draft
authorKyle Machulis <kyle@nonpolynomial.com>
Fri, 08 Sep 2017 13:02:22 -0700
changeset 661608 d46708035ce72c696a571e7a4e7fad8b961000b5
parent 661607 36d8aebae3fcf250fa1e913de0afdff57ee9f0be
child 730646 264dd9635efee08d9baae32ae32de3abd31654a3
push id78841
push userbmo:kyle@nonpolynomial.com
push dateFri, 08 Sep 2017 20:22:41 +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/"))) {