0

I want to allow the users of my web app to create their own custom JS, which should be stored in a string and be parsed (preferably without having to use the evil eval). I am using Angular.

What is the best way to do this and is there any risk when the users JS is only stored in localStorage and not shared with other users?

Stefan Blamberg
  • 816
  • 9
  • 24
  • Possible duplicate of [JavaScript - Save object with methods as a string](http://stackoverflow.com/questions/40875630/javascript-save-object-with-methods-as-a-string) If the JS string is stored in `localStorage`, it cannot be seen by other users. – Scott Marcus Dec 06 '16 at 23:06
  • What do you want to do with the JS? – SLaks Dec 06 '16 at 23:07
  • I am creating a todo webapp where users should be allowed to write their own functions to custimze their experience – Stefan Blamberg Dec 06 '16 at 23:09
  • Can you define "custimze their experience"? – Scott Marcus Dec 06 '16 at 23:13
  • The user can create cards which contain text, pictures, videos, etc. There should be the option to create your own, interactive cards - e.G. a card that outputs a daily motivational quote.. – Stefan Blamberg Dec 06 '16 at 23:29
  • 3
    You shouldn't be allowing JavaScript input for this. You can create the JavaScript functions that do the work and only rely on the user's to input parameters that tell your functions exactly what to build. – Scott Marcus Dec 06 '16 at 23:40

0 Answers0