I have a third party script that loads an image through their JavaScript. After leaving the page alone for 15-20 minutes, though, I'll suddenly have
thousands of errors in the console (they pop up all at once):
VM115367 abilene.js
POST
https://www.example.com/detroitchicago/greenoaks.gif?orig=1&ds=[random 1500 chars]
net::ERR_INSUFFICIENT_RESOURCES
abilene.js is their script, so I don't have access to it. And while /detroitchicago/greenoaks.gif looks like it's on my server, it's really not; there's just a DNS setting somewhere that makes it look that way. And how is the method POST, you might ask? I have no clue.
But when this error happens, it makes the page freeze up. And then, the only way out is to close the tab.
Any suggestions on how to watch for this error, and stop it before it happens?
I tried this, but the expected warning didn't show up in the console:
document.querySelector("img[src*='greenoaks.gif']").addEventListener('error', () => {
console.log('error loading greenoaks.gif');
});