I'm using Chrome's remote debugging protocol to get console messages when loading Chrome up for a site.

But I wondered if there's a way to script Edge to do the same?

I know I can look in the console itself, or add some script to the page to do this, but I'm trying to do it from an external point of view.

E.g. With a script to automatically load up the Edge browser, navigate to a page, and have it log any console messages it find to a file somewhere.

1

There are 1 best solutions below

3
On

You could write a function and send all console messages to the function which would console.log the output and send it to your server via AJAX for appending to a file. A nodejs microservice would be quick and simple to do this with. I've done this for a quick and dirty logging system when developing. I try to log with a datatime stamp, user, etc and what the output was.

I am assuming that you do not want this long term (console logs in production is a poor idea).