Overriding console in an iFrame
This post talks about overriding your console logs in an iFrame on your own domain where you have access to the code inside the iframe.
This might be because you are building a code editor or just executing user code inside an iframe for security reasons.
Our aim is to take the console logs outside the iframe into the main window and process them.
First inside the iframe,
Remember to put this before any other JavaScript being executed.
Now, inside our parent code:
Overriding other methods.
You can override other console methods by changing up console.log to other functions like console.table
If you want to display the logs, react-inspector is a good place to start.
Happy Coding.