Bug 1948714 - Add a CSP to formautofill manageAddresses.xhtml. r=credential-management-reviewers,mtigley

Differential Revision: https://phabricator.services.mozilla.com/D238626
This commit is contained in:
Tom Schuster
2025-02-19 09:30:52 +00:00
parent 5f7024f939
commit ce402789c2
3 changed files with 21 additions and 16 deletions

View File

@@ -0,0 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { ManageAddresses } from "chrome://formautofill/content/manageDialog.mjs";
new ManageAddresses({
records: document.getElementById("addresses"),
controlsContainer: document.getElementById("controls-container"),
remove: document.getElementById("remove"),
add: document.getElementById("add"),
edit: document.getElementById("edit"),
});

View File

@@ -10,12 +10,20 @@
>
<head>
<title data-l10n-id="autofill-manage-addresses-title"></title>
<meta
http-equiv="Content-Security-Policy"
content="default-src chrome:; style-src chrome: 'unsafe-inline';"
/>
<link rel="localization" href="browser/preferences/formAutofill.ftl" />
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" />
<link
rel="stylesheet"
href="chrome://formautofill/content/manageDialog.css"
/>
<script
type="module"
src="chrome://formautofill/content/manageAddresses.mjs"
></script>
</head>
<body>
<fieldset>
@@ -38,20 +46,5 @@
data-l10n-id="autofill-manage-edit-button"
/>
</div>
<!-- eslint-disable -->
<!-- For some reason eslint complains here about import only available for sourceType: "module" -->
<!-- even though type is set to module.-->
<script type="module">
import { ManageAddresses } from "chrome://formautofill/content/manageDialog.mjs";
new ManageAddresses({
records: document.getElementById("addresses"),
controlsContainer: document.getElementById("controls-container"),
remove: document.getElementById("remove"),
add: document.getElementById("add"),
edit: document.getElementById("edit"),
});
</script>
<!-- eslint-enable -->
</body>
</html>

View File

@@ -1793,7 +1793,6 @@ void nsContentSecurityUtils::AssertChromePageHasCSP(Document* aDocument) {
"chrome://devtools/content/shared/webextension-fallback.html"_ns,
"chrome://devtools/skin/images/alert.svg"_ns,
"chrome://extensions/content/dummy.xhtml"_ns,
"chrome://formautofill/content/manageAddresses.xhtml"_ns,
"chrome://formautofill/content/manageCreditCards.xhtml"_ns,
"chrome://geckoview/content/geckoview.xhtml"_ns,
"chrome://gfxsanity/content/sanityparent.html"_ns,