0

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;
});

Nolan Carpenter
  • 120
  • 1
  • 9
  • Only possible for a site you have control over, *or* if you can install a userscript or extension that does it for you - and even then, it won't be so useful. IMO, best method would be to bring your own computer, or remote desktop into your computer at home. A reasonable school might see how assigning a student a web dev project but preventing them from Inspecting is counter-productive, too... – CertainPerformance Nov 17 '21 at 02:46
  • @CertainPerformance Erm... This wasn't assigned... But anyways, I may have come up with an idea. I know that you can run javascript from a bookmark, so maybe I could add some sort of eventlistener through the bookmark? You said that I would need to own the website, so if I did, what would the eventlistener identifier be? (I would just have to run the bookmark every time I loaded the page) – Nolan Carpenter Nov 17 '21 at 03:46

0 Answers0