Issue #3268Opened February 12, 2021by theSC0RP0 reactions

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)

theSC0RPFebruary 18, 20210 reactions

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: Screenshot from 2021-02-18 10-54-24

artfFebruary 19, 20210 reactions

Can you provide a reproducible demo of your issue, please?

theSC0RPFebruary 23, 20210 reactions

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.