我正在寻找一种方法来替换可以在页面上的任何位置使用的图像。
因此,如果我们有一个这样的示例 html 页面:
<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>
无论何时 - example.com/img/1889.png - 出现,都必须用其他东西替换。
编辑
不幸的是,我不能使用任何 javascript 库。它用于浏览器插件。我也不能使用浏览器特定的 API