Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making CT compatible with CSP style-src set to 'self' #567

Open
jnnkB opened this issue Jun 15, 2020 · 0 comments
Open

Making CT compatible with CSP style-src set to 'self' #567

jnnkB opened this issue Jun 15, 2020 · 0 comments

Comments

@jnnkB
Copy link

jnnkB commented Jun 15, 2020

When you set the value of style-src to 'self', ContentTools fails to apply some styles. This comes from using node.setAttribute("style", …) instead of node.style.attrubute = ... as you can read here.

I think it might not be that easy because you use code like this:

this._domElement.setAttribute('style', this._attributes['style']);

But it should be possible to store the styles as a map instead and to something like:

styles = {"background": "red"}
for (style in styles) {
    this._domElement.style[style] = styles[style]
}

I really would appreciate if you could implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant