Is there a way to run a script in front end in Virtual agent using <script> tag
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 03:27 AM
Is there a way to run a script in front end in Virtual agent?
For example, I tried using the following code to import a package and render an adaptive card in VA
in HTML input type but it does not execute as due to HTML sanitization which removes all script tags.
<script type="text/javascript" src="https://unpkg.com/markdown-it/dist/markdown-it.js"></script>
<script type="text/javascript" src="https://unpkg.com/adaptivecards@2.6.0/dist/adaptivecards.js"></script>
<script>
//the following variables become available once the above pacakages are imported
var adaptiveCard = new AdaptiveCards.AdaptiveCard();
adaptiveCard.hostConfig = new AdaptiveCards.HostConfig({fontFamily: "Segoe UI, Helvetica Neue, sans-serif"});
adaptiveCard.onExecuteAction = function(action) { window.open(action.url); };
adaptiveCard.parse(card); var renderedCard = adaptiveCard.render();
}
</script>
There was a property "com.glide.cs.html.sanitizer.enabled" that allowed to execute script in VA when set to true but in Vancouver it has been deprecated and it does not allow to execute such code in front end
Is there any way to do the same without script tag?
Labels:
- Labels:
-
Virtual Agent
0 REPLIES 0