Bug 1954941. Add CSP to load_device.xhtml r=tschuster
Differential Revision: https://phabricator.services.mozilla.com/D242286
This commit is contained in:
@@ -1293,6 +1293,7 @@ static nsLiteralCString sStyleSrcUnsafeInlineAllowList[] = {
|
|||||||
"chrome://pippki/content/device_manager.xhtml"_ns,
|
"chrome://pippki/content/device_manager.xhtml"_ns,
|
||||||
"chrome://pippki/content/downloadcert.xhtml"_ns,
|
"chrome://pippki/content/downloadcert.xhtml"_ns,
|
||||||
"chrome://pippki/content/editcacert.xhtml"_ns,
|
"chrome://pippki/content/editcacert.xhtml"_ns,
|
||||||
|
"chrome://pippki/content/load_device.xhtml"_ns,
|
||||||
};
|
};
|
||||||
// img-src data: blob:
|
// img-src data: blob:
|
||||||
static nsLiteralCString sImgSrcDataBlobAllowList[] = {
|
static nsLiteralCString sImgSrcDataBlobAllowList[] = {
|
||||||
@@ -1936,7 +1937,6 @@ void nsContentSecurityUtils::AssertChromePageHasCSP(Document* aDocument) {
|
|||||||
"chrome://global/skin/in-content/info-pages.css"_ns,
|
"chrome://global/skin/in-content/info-pages.css"_ns,
|
||||||
"chrome://layoutdebug/content/layoutdebug.xhtml"_ns,
|
"chrome://layoutdebug/content/layoutdebug.xhtml"_ns,
|
||||||
"chrome://pippki/content/exceptionDialog.xhtml"_ns,
|
"chrome://pippki/content/exceptionDialog.xhtml"_ns,
|
||||||
"chrome://pippki/content/load_device.xhtml"_ns,
|
|
||||||
"chrome://pippki/content/setp12password.xhtml"_ns,
|
"chrome://pippki/content/setp12password.xhtml"_ns,
|
||||||
// Test files
|
// Test files
|
||||||
"chrome://mochikit/"_ns,
|
"chrome://mochikit/"_ns,
|
||||||
|
|||||||
@@ -81,3 +81,12 @@ function validateModuleName() {
|
|||||||
dialogNode.setAttribute("buttondisabledaccept", true);
|
dialogNode.setAttribute("buttondisabledaccept", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
document
|
||||||
|
.getElementById("device_name")
|
||||||
|
.addEventListener("change", () => validateModuleName());
|
||||||
|
document
|
||||||
|
.getElementById("browse")
|
||||||
|
.addEventListener("command", () => onBrowseBtnPress());
|
||||||
|
});
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- 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/. -->
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||||
|
|
||||||
|
<?csp default-src chrome:; style-src chrome: 'unsafe-inline'; ?>
|
||||||
|
|
||||||
<!DOCTYPE window>
|
<!DOCTYPE window>
|
||||||
|
|
||||||
<window
|
<window
|
||||||
@@ -36,18 +38,12 @@
|
|||||||
id="device_name"
|
id="device_name"
|
||||||
data-l10n-id="load-device-modname-default"
|
data-l10n-id="load-device-modname-default"
|
||||||
data-l10n-attrs="value"
|
data-l10n-attrs="value"
|
||||||
onchange="validateModuleName();"
|
|
||||||
/>
|
/>
|
||||||
</hbox>
|
</hbox>
|
||||||
<hbox align="center">
|
<hbox align="center">
|
||||||
<label data-l10n-id="load-device-filename" control="device_path" />
|
<label data-l10n-id="load-device-filename" control="device_path" />
|
||||||
<html:input id="device_path" />
|
<html:input id="device_path" />
|
||||||
<button
|
<button id="browse" flex="1" data-l10n-id="load-device-browse" />
|
||||||
id="browse"
|
|
||||||
flex="1"
|
|
||||||
data-l10n-id="load-device-browse"
|
|
||||||
oncommand="onBrowseBtnPress();"
|
|
||||||
/>
|
|
||||||
</hbox>
|
</hbox>
|
||||||
<label id="helpText" value="" />
|
<label id="helpText" value="" />
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ async function testModuleNameHelper(moduleName, acceptButtonShouldBeDisabled) {
|
|||||||
let moduleNameBox = win.document.getElementById("device_name");
|
let moduleNameBox = win.document.getElementById("device_name");
|
||||||
moduleNameBox.value = moduleName;
|
moduleNameBox.value = moduleName;
|
||||||
// this makes this not a great test, but it's the easiest way to simulate this
|
// this makes this not a great test, but it's the easiest way to simulate this
|
||||||
moduleNameBox.onchange();
|
moduleNameBox.dispatchEvent(new Event("change", { bubbles: true }));
|
||||||
|
|
||||||
let dialogNode = win.document.querySelector("dialog");
|
let dialogNode = win.document.querySelector("dialog");
|
||||||
Assert.equal(
|
Assert.equal(
|
||||||
|
|||||||
Reference in New Issue
Block a user