Is there a way to track changes in the src attribute of images created using the Image constructor on a webpage without needing the image to be fully loaded? I have attempted to override the Image.onload method, but it does not log anything:
Image.prototype.nativeOnload = Image.prototype.onload;
Image.prototype.onload = function() {
console.log(this.src);
this.nativeOnload();
};
It seems that the onload property might be causing some issues. How can I achieve this using JavaScript without directly watching for changes?