awesome-chrome-devtools
awesome-chrome-devtools copied to clipboard
Capture Console?
Beginner question:
Is it possible to capture all chrome console messages using javascript? This would be a stand-alone chrome browser, not headless. Running inside the same browser-instance-- not a client/remote browser.
What's the simplest, most lightweight solution?
thx!
I don't believe there is any exposure to intercept those messages. What is your use-case for needing such a feature?
Display them on a front-end IDE, embedded in a webpage, using the local JS engine.
IDEs tend to connect using remote debugging which allows API access via the Chrome DevTools Protocol. That way your IDE is the debugger for the app rather than having DevTools open and your IDE. That's how they tend to get access to the logs.
Would using the remote debugging setup not work for some reason?
I had a similar problem. My solution was to edit the console functions: https://github.com/Yash-Singh1/zoom.js/blob/master/test/auto.js#L3