Issue #721Opened January 5, 2018by wvaymen0 reactions

adding component script js

Question

I have question about injecting script js into GrapesJs. Can I adding <script> into grapesJS using function editor.getComponents().add() and not injecting using javascript. document.createElement('script')

Answers (2)

artfJanuary 8, 20180 reactions

@wvaymen sure, but you have to enable script importing before

const editor = grapesjs.init({
	...
	allowScripts: 1,
});
editor.addComponents('<script>alert(1)</script>');
lock[bot]September 18, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.