Bug 1888695 - Add a pref for the iframe XFO/CSP Open In New Window button. r=dveditz

Differential Revision: https://phabricator.services.mozilla.com/D206911
This commit is contained in:
Tom Schuster 2024-05-02 10:55:56 +00:00
parent 292449038b
commit b566e47150
5 changed files with 12 additions and 1 deletions

View file

@ -8,6 +8,10 @@ const BLOCKED_PAGE =
"http://example.org:8000/browser/browser/base/content/test/about/csp_iframe.sjs";
add_task(async function test_csp() {
await SpecialPowers.pushPrefEnv({
set: [["security.xfocsp.hideOpenInNewWindow", false]],
});
let { iframePageTab, blockedPageTab } = await setupPage(
"iframe_page_csp.html",
BLOCKED_PAGE

View file

@ -8,6 +8,10 @@ const BLOCKED_PAGE =
"http://example.org:8000/browser/browser/base/content/test/about/xfo_iframe.sjs";
add_task(async function test_xfo_iframe() {
await SpecialPowers.pushPrefEnv({
set: [["security.xfocsp.hideOpenInNewWindow", false]],
});
let { iframePageTab, blockedPageTab } = await setupPage(
"iframe_page_xfo.html",
BLOCKED_PAGE

View file

@ -39,6 +39,7 @@ pref("security.signed_app_signatures.policy", 2);
pref("security.xfocsp.errorReporting.enabled", true);
pref("security.xfocsp.errorReporting.automatic", false);
pref("security.xfocsp.hideOpenInNewWindow", true);
// Issuer we use to detect MitM proxies. Set to the issuer of the cert of the
// Firefox update service. The string format is whatever NSS uses to print a DN.

View file

@ -396,7 +396,8 @@ function initPage() {
});
longDesc = null;
document.getElementById("openInNewWindowContainer").hidden = false;
document.getElementById("openInNewWindowContainer").hidden =
RPMGetBoolPref("security.xfocsp.hideOpenInNewWindow");
const openInNewWindowButton = document.getElementById(
"openInNewWindowButton"

View file

@ -103,6 +103,7 @@ export let RemotePageAccessManager = {
"security.certerror.hideAddException",
"security.xfocsp.errorReporting.automatic",
"security.xfocsp.errorReporting.enabled",
"security.xfocsp.hideOpenInNewWindow",
"network.trr.display_fallback_warning",
],
RPMSetPref: [