From e2186a9065072bdc1f87d7427a1363a47f77032e Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Wed, 16 Jun 2021 11:53:08 +1200 Subject: [PATCH] Bug 1716676 - Port bug 1646560 - Move allowJavascript and friends from DocShell to BrowsingContext and WindowContext. rs=bustage-fix --HG-- extra : rebase_source : d03f993445ee3d6e4236d3e6d3ad91c33623d9d8 --- mailnews/base/content/junkLog.js | 2 +- mailnews/base/src/nsMsgContentPolicy.cpp | 4 ++-- mailnews/search/content/viewLog.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mailnews/base/content/junkLog.js b/mailnews/base/content/junkLog.js index 07f3b47496..28afda6f5b 100644 --- a/mailnews/base/content/junkLog.js +++ b/mailnews/base/content/junkLog.js @@ -13,7 +13,7 @@ var gLogFile; function onLoad() { gLogView = document.getElementById("logView"); - gLogView.docShell.allowJavascript = false; // for security, disable JS + gLogView.browsingContext.allowJavascript = false; // for security, disable JS gLogView.addEventListener("load", () => { addStyling(); diff --git a/mailnews/base/src/nsMsgContentPolicy.cpp b/mailnews/base/src/nsMsgContentPolicy.cpp index e9e84bffba..0a3d37c208 100644 --- a/mailnews/base/src/nsMsgContentPolicy.cpp +++ b/mailnews/base/src/nsMsgContentPolicy.cpp @@ -841,7 +841,7 @@ nsresult nsMsgContentPolicy::SetDisableItemsOnMailNewsUrlDocshells( if (!isAllowedContent) { // Disable JavaScript on message URLs. - rv = docShell->SetAllowJavascript(false); + rv = browsingContext->SetAllowJavascript(false); NS_ENSURE_SUCCESS(rv, rv); rv = browsingContext->SetAllowContentRetargetingOnChildren(false); NS_ENSURE_SUCCESS(rv, rv); @@ -871,7 +871,7 @@ nsresult nsMsgContentPolicy::SetDisableItemsOnMailNewsUrlDocshells( NS_ENSURE_SUCCESS(rv, rv); } else { // JavaScript is allowed on non-message URLs. - rv = docShell->SetAllowJavascript(true); + rv = browsingContext->SetAllowJavascript(true); NS_ENSURE_SUCCESS(rv, rv); rv = browsingContext->SetAllowContentRetargetingOnChildren(true); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mailnews/search/content/viewLog.js b/mailnews/search/content/viewLog.js index 291639b78d..3d9ccad5e4 100644 --- a/mailnews/search/content/viewLog.js +++ b/mailnews/search/content/viewLog.js @@ -19,7 +19,7 @@ function onLoad() { gLogView = document.getElementById("logView"); // for security, disable JS - gLogView.docShell.allowJavascript = false; + gLogView.browsingContext.allowJavascript = false; MailE10SUtils.loadURI(gLogView, gFilterList.logURL); }