Bug 1956801. Add CSP to win.xhtml r=mossop

Differential Revision: https://phabricator.services.mozilla.com/D243580
This commit is contained in:
Simon Friedberger
2025-04-03 10:04:57 +00:00
parent c3f11a58b2
commit ba25883f84
4 changed files with 10 additions and 14 deletions

View File

@@ -100,10 +100,10 @@ async function takeScreenshot(
let browser = doc.createXULElement("browser");
browser.setAttribute("remote", "true");
browser.setAttribute("type", "content");
browser.setAttribute(
"style",
`width: ${contentWidth}px; min-width: ${contentWidth}px; height: ${contentHeight}px; min-height: ${contentHeight}px;`
);
browser.style.width = `${contentWidth}px`;
browser.style.minWidth = `${contentWidth}px`;
browser.style.height = `${contentHeight}px`;
browser.style.minHeight = `${contentHeight}px`;
browser.setAttribute("maychangeremoteness", "true");
doc.documentElement.appendChild(browser);

View File

@@ -1960,7 +1960,6 @@ void nsContentSecurityUtils::AssertChromePageHasCSP(Document* aDocument) {
"chrome://global/content/backgroundPageThumbs.xhtml"_ns,
"chrome://global/content/megalist/megalist.html"_ns,
"chrome://global/content/selectDialog.xhtml"_ns,
"chrome://global/content/win.xhtml"_ns,
// Test files
"chrome://mochikit/"_ns,
"chrome://mochitests/"_ns,

View File

@@ -167,15 +167,10 @@ export const HiddenBrowserManager = new (class HiddenBrowserManager {
let browser = doc.createXULElement("browser");
browser.setAttribute("remote", "true");
browser.setAttribute("type", "content");
browser.setAttribute(
"style",
`
width: ${BACKGROUND_WIDTH}px;
min-width: ${BACKGROUND_WIDTH}px;
height: ${BACKGROUND_HEIGHT}px;
min-height: ${BACKGROUND_HEIGHT}px;
`
);
browser.style.width = `${BACKGROUND_WIDTH}px`;
browser.style.minWidth = `${BACKGROUND_WIDTH}px`;
browser.style.height = `${BACKGROUND_HEIGHT}px`;
browser.style.minHeight = `${BACKGROUND_HEIGHT}px`;
browser.setAttribute("maychangeremoteness", "true");
doc.documentElement.appendChild(browser);

View File

@@ -3,4 +3,6 @@
- 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/. -->
<?csp default-src chrome:; ?>
<window id="win" />