Skip to content

Inline style blocks and CSP #377

@spdawson

Description

@spdawson

Trix injects a couple of inline <style> blocks into the page <head>: one for the editor itself, and another for the toolbar. Neither block includes a nonce attribute; consequently, the CSP must include 'unsafe-inline' in the style-src directive.

It would be nice to be able to either:

  1. Have Trix auto-generate nonce attributes for its inline style blocks, or...
  2. Preferably, eliminate the need for these inline <style> blocks altogether

Maybe I'm missing the point, but these <style> blocks appear not to contain anything that could not be factored out into the existing trix.css external stylesheet.

Steps to Reproduce
  1. Use Trix
  2. Inspect the page source
  3. See the inline <style> blocks that Trix has injected
Details
  • Trix version: 0.10.1
  • Browser name and version: Chromium 56.0.2924.76
  • Operating system: Ubuntu 16.04 (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions