mdaffin/sprockit.io

Get `console.log` in the scripts to print to the output window.

Closed this issue · 1 comments

Currently you have to have the dev tools open to see output from your script. It would be better to include this inside the UI somewhere.

One way might be to overrite console.log (and similar methods) in the iframe: https://stackoverflow.com/questions/11049996/redirect-calls-to-console-log-to-standard-output-in-jasmine-tests#11050414 .

Then append them to a element inside the iframe. Though this means that they could delete or edit the elements used output the logs.

https://stackoverflow.com/questions/14924362/capture-console-log-of-an-iframe Might be a better way.

Implemented and has a basic component test. But it needs a test that verifies that when a script running in the iframe logs some output it is displayed in the console.