Open johnaweiss opened 4 years ago
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
Hey @johnaweiss and @Yash-Singh1 this will probably be too late for you but for anyone else who wants this in future: you could proxy the debugger front-end. I have created a project that does that, here: devtoolium
You could fork this and implement your own interception
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!