TWSViewInjectionExample

fun TWSViewInjectionExample(twsInjectionViewModel: TWSInjectionViewModel = hiltViewModel())

Demonstrates how to dynamically inject external resources into a TWSView using the dynamicResources property.

The dynamicResources field in the TWSSnippet allows you to inject external resources (CSS, JavaScript) to your web page to enhance the behavior or add styling of the rendered content. This provides a powerful mechanism to customize the appearance or functionality of the content loaded in TWSView.

In this example, we add a CSS and Javascript files to original HTML. The attached resources are specified with a URL and a content type of CSS. All resources are already prepared and added to the snippet on the platform (can be found on snippet details page, under the dynamic resources), so no specific code is required to enable this feature.

A working example can be found here. Download the Sample app from our web page to explore this functionality interactively.