Commit a5d0bb21 authored by Patti's avatar Patti Committed by Commit Bot

MediaApp: Allow CSS files sourced from chrome-untrusted://media-app/*.

dark_cros_styles.css, which contains the EA semantic colors for dark
mode, was being shipped with the media app SWA package without being
linked in the HTML. The fix for this was to dynamically link the CSS in
index.ts instead, but this violates the existing SWA CSP.

Fix by updating the CSP to allow styles sourced from the 'self' source,
which should allow everything from chrome-untrusted://media-app/*.

Bug: b/166688012
Change-Id: I1a141b324470586e02418c6aa872ca3800403a88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2379440
Commit-Queue: Patti <patricialor@chromium.org>
Auto-Submit: Patti <patricialor@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803764}
parent 2ba4b102
......@@ -59,7 +59,8 @@ content::WebUIDataSource* CreateMediaAppUntrustedDataSource(
network::mojom::CSPDirectiveName::ImgSrc, "img-src blob: data: 'self';");
// Allow styles to include inline styling needed for Polymer elements.
source->OverrideContentSecurityPolicy(
network::mojom::CSPDirectiveName::StyleSrc, "style-src 'unsafe-inline';");
network::mojom::CSPDirectiveName::StyleSrc,
"style-src 'self' 'unsafe-inline';");
// TODO(crbug.com/1098685): Trusted Type remaining WebUI.
source->DisableTrustedTypesCSP();
return source;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment