QUESTION: How to add javascript in the html without sanitization?
Question
Hey @artf, I am taking javascript input from the user. I need to add this javascript inside the template HTML but it gets sanitized.
Is there a way that I can turn off the sanitization? (I don't have an issue with the problems you mentioned in #3245 ) or can you add a property in the editor like allowSanitization: false
If not, then how can I add the javascript to the canvas?
Answers (3)
I tried adding the script to the iframe in which the canvas renders by adding a <script> tag at the end of the body of the iframe. This works to some extent. The problem here is that when I need to update the js inside the script I will need to refresh the iframe (to remove any event listeners if present) and doing so gives me the following error:

Can you provide a reproducible demo of your issue, please?
Thanks for the reply @artf. I was doing a mistake while updating the iframe so now my problem is solved! Just another question, is there any built-in method to refresh the iframe?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3249
QUESTION regarding JSON stored by the StorageManager
Hey, @artf. I want to access the json that is generated when a template is stored without actually storing the template. The json object ca...
Issue #1888
[Question] Add custom html inside canvas
Hi there, I'm using grapes to export a custom json with all the information i need, instead of HTML and CSS. For doing that I'm parsing the...
Issue #2238
[QUESTION] How to get style for header & footer components only
Hi @artf, can you please tell me what is the fastest and easies way to extract component styles. I have template and in this template you c...
Issue #913
[Question] Using Style tag instead of css
Hi, I've been taking a look inside of the dom_components, but cant seem to figure out how to manually override the styling aspect. I need a...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.