I am developing a Chrome Extension for GMail. When I open a sent mail, if an image is attached, it is downloaded from server. I want to prevent browser hitting GET /url.
I have tried -
document.addEventListener("DOMSubtreeModified",function(){
$("img-selector").remove();
},true);
I have also used mutation observer. Both methods remove the <img> from DOM, but I can still see browser hitting that image url in Network panel.
So, how can I prevent browser hitting the url, and removing the img? It needs to be done in Content Script. You can assume JQuery library is available.
Thanks in advance.