My school has blocked the inspect feature on our computers, which makes it incredibly hard to debug a project while I'm at school. I an looking to create a simple website (because that seems like that's the only thing my school will allow me to do anymore) that will open a website, then output all errors/warnings/console logs to a DOM element. I know how to open a window and store it in a variable, but I'm not sure where to start to read from the console's output. I am also wondering how I would detect when something is added to the console, as the new window will be on a new domain and we all know that CORS will have a fit if we try to do anything to it (like add an event listener to it?).
var newWindow = window.open("https://google.com");
newWindow.addEventListener("consoleupdate", consoleText => { // <-- What would I put here instead?
document.getElementById("output").textContent = consoleText;
});