XML Viewer inline styles are blocked by server-provided CSP |
|
Issue descriptionDemo: https://www.martijnc.be/test/xml-csp.php Chrome's XML viewer turns XML files into HTML and applies styling. This styling is blocked when the server-provided Content Security Policy doesn't allow inline styles (unsafe-inline) resulting in an unstyled, unreadable page.
,
Oct 28
#1 - here are two probably-easy-to-implement ways to improve this - - You can move the content of that <style> to a user agent stylesheet (view-source.css already has some of the rules used by the XML viewer). That sounds easy and will already improve a lot. - You can switch any JavaScript implemented expand/collapse to <summary> and <details>. That might require ::marker (not stable yet) to make it look the same, but even without it, it is better than the current situation. Less easy, I guess, but does not sound a lot harder. Alternatively, you can make it fully use the view-source mode when (a relevant?) content security policy is active. |
|
►
Sign in to add a comment |
|
Comment 1 by mkwst@chromium.org
, Mar 27 2018Labels: OS-Android OS-Chrome OS-Linux OS-Mac OS-Windows
Status: Available (was: Untriaged)