Bug 968334 Disable content retargeting in messages (38 version) r=Standard8, a=rkent
☠☠ backed out by 6e8da969cd36 ☠ ☠
authorR Kent James <rkent@caspia.com>
Wed, 29 Apr 2015 13:35:20 -0700
changeset 22831 16c1af11167f76d2221bf78c6b5a1216d220e841
parent 22830 ef2dc070e81444c8c978cd32a841afe7fcbc05d0
child 22832 4f1cad9b6bd8e871700cd0d7d1e8ead2bd88a1b7
child 22835 6e8da969cd36ecf4b996021450d4e7c18287a937
push id225
push usermbanner@mozilla.com
push dateMon, 29 Jun 2015 15:56:24 +0000
reviewersStandard8, rkent
bugs968334
Bug 968334 Disable content retargeting in messages (38 version) r=Standard8, a=rkent
mailnews/base/src/nsMsgContentPolicy.cpp
--- a/mailnews/base/src/nsMsgContentPolicy.cpp
+++ b/mailnews/base/src/nsMsgContentPolicy.cpp
@@ -694,27 +694,34 @@ nsresult nsMsgContentPolicy::SetDisableI
   rv = docshellTreeItem->GetItemType(&itemType);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // we're only worried about policy settings in content docshells
   if (itemType != nsIDocShellTreeItem::typeContent) {
     return NS_OK;
   }
 
+  nsCOMPtr<nsIDocShell_ESR38> docShellESR38(do_QueryInterface(docShell));
+  NS_ENSURE_SUCCESS(rv, rv);
+
   if (!isAllowedContent) {
     // Disable JavaScript on message URLs.
     rv = docShell->SetAllowJavascript(false);
     NS_ENSURE_SUCCESS(rv, rv);
+    rv = docShellESR38->SetAllowContentRetargetingOnChildren(false);
+    NS_ENSURE_SUCCESS(rv, rv);
     rv = docShell->SetAllowPlugins(mAllowPlugins);
     NS_ENSURE_SUCCESS(rv, rv);
   }
   else {
     // JavaScript and plugins are allowed on non-message URLs.
     rv = docShell->SetAllowJavascript(true);
     NS_ENSURE_SUCCESS(rv, rv);
+    rv = docShellESR38->SetAllowContentRetargetingOnChildren(true);
+    NS_ENSURE_SUCCESS(rv, rv);
     rv = docShell->SetAllowPlugins(true);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
 
 /**