Try our conversational search powered by Generative AI!

Added support for attributes on static client resources

Fixed in

EPiServer.CMS.Core 12.1.0

(Or a related package)

Created

Mar 18, 2021

Updated

Nov 16, 2021

Area

CMS Core

State

Closed, Fixed and tested


Description

Added support for attributes on static client resources.

The class EPiServer.Framework.Web.Resources.ClientResource.cs should have a dictionary of attributes that are added to the html element.

One example where it can be used:

Add SRI - Sub Resource integrity, on injected scripts. ClientResource should provide a way to add the integrity attribute on the generated html element.

Example:
 
{{<script src="https://example.com/example-framework.js"integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9