I need a solution to swap out an image that is used in multiple locations on a webpage.
Consider this sample HTML page:
<html>
<head>
</head>
<body>
<img id="1" src="example.com/img/1889.png">
<div style="background: url('example.com/img/1889.png')">
<div>
<a>
<img id="2" src="example.com/img/1889.png">
</a>
</body>
</html>
Wherever the URL example.com/img/1889.png is found, it needs to be replaced with something different.
UPDATE
Regrettably, I am restricted from using any JavaScript libraries as this is for a browser extension. Additionally, browser-specific APIs cannot be utilized.