# HtmlExternalAssets

Moves every inline script and style of ChartForgeX HTML into asset files, for pages served under a policy that loads scripts and styles only from files, such…

 Class  

`ChartForgeX.Interactivity.Html`

**Namespace**

`ChartForgeX.Interactivity.Html`

**Assembly**

`ChartForgeX.Interactivity.Html`

**Source**

[HtmlExternalAssets.cs:31](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Interactivity.Html/HtmlExternalAssets.cs#L31)

**Modifiers**

static

Moves every inline script and style of ChartForgeX HTML into asset files, for pages served under a policy that loads scripts and styles only from files, such as script-src 'self'; style-src 'self'.

## Inheritance

- object
- HtmlExternalAssets

## Remarks

Style attributes become generated cfx-s- classes and, with every style element, move into one stylesheet linked at the end of head (see [HtmlStrictStyles](/api/chartforgex-html-htmlstrictstyles/)). Each executable inline script becomes a script file loaded from the same place in the document, so scripts still run in order and find their position through document.currentScript. Data blocks such as <script type="application/json"> stay inline: browsers never execute them, so the policy does not apply to them. File names carry a content hash, so the runtimes shared by several pages are written once. The graph explorer's physics worker becomes its own file, so the policy needs no blob: source for it.

 Filter members   

    Show inherited   

 

## Methods

 `public static HtmlExternalPage Split(string html, HtmlAssetReferences assets)` [#](#method-split-string-chartforgex-interactivity-html-htmlassetreferences) 

[HtmlExternalAssets.cs:31](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Interactivity.Html/HtmlExternalAssets.cs#L31)

Splits a ChartForgeX page or fragment into markup without inline scripts or styles and the files it loads.

Parameters

**html string required**

A page or fragment produced by a ChartForgeX renderer, with or without its own asset references.

**assets ChartForgeX.Interactivity.Html.HtmlAssetReferences required**

Where the page loads the files from. Write [HtmlExternalPage.Files](/api/chartforgex-interactivity-html-htmlexternalpage/) there.

Returns

 `HtmlExternalPage` The markup and the asset files it references. 

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

## Fields

 `public const string StyleSheetAttribute` [#](#field-stylesheetattribute) 

[HtmlExternalAssets.cs:24](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Interactivity.Html/HtmlExternalAssets.cs#L24)

The attribute that marks the stylesheet link added for the page's own styles.

Value: `data-cfx-external-styles`

<!-- PowerForge markdown artifact sha256:DF4A2351DFCCCFD6CD4B0EFC29DC385933520150372C02930E989CE2981911FF -->
