f-twelve
f-twelve copied to clipboard
Enhance command parser
The console uses parseCommand
to support reading and assigning variables but functionality is very limited as it is not a true command parser. Opting not to use Function
because executing unchecked user input poses security concerns.
This is a solution that uses Function
with an allowlist strategy so that only supported members on window
can be executed: https://stackoverflow.com/a/46374395
This is ideal as it would allow debugging with Intl
which has been a common cause of issues in embedded IE.
The stackoverflow option above is useless. This or something like it seems better: https://github.com/asvd/jailed Demo site: http://asvd.github.io/jailed/demos/web/console/
Or run in a sandboxed iframe https://stackoverflow.com/a/26488003