Content security policy

1 Answer 53 Views
Editor
Lenny
Top achievements
Rank 1
Lenny asked on 04 Oct 2024, 02:51 PM
We are enabling strict CSP policies. We have managed to get all components working with the exception of the editor component.  The default was to set the height of the component is to set a style='height:400px; width:300px" This causes the browser to complain about in-line styles. Is there another way to set the height and width of the component? We are getting issues with the setting of in-line styles by the editor. We are currently setting the nonce property on the tag helper for the editor component. Are we missing something?

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 09 Oct 2024, 07:07 AM

Hello Lenny,

To make the Editor component CSP-compliant, you need to set the "nonce" and "unsafe-inline" attributes, as described in the following section in the documentation:

    <kendo-editor name="editor" nonce="@nonce" unsafe-inline="false">
    </kendo-editor>

Also, to set width and height of the Editor, you can apply them to the "k-editor" class:

<style nonce="@nonce">
    .k-editor{
        width: 100%;
        height: 200px;
    }
</style>

If any questions arise, don't hesitate to let me know.

 

Regards,
Mihaela
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Editor
Asked by
Lenny
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or