I'm trying to change the URL's of a webpage on the fly using Greasemonkey.
The target page has links like:
<a name="217258323" href="http://foobar.net/photo/217258323/?pgid=&gid=4933418&page=0">
<img style="border:1px solid #fff;padding:5px;background:#fff;"
height="120" width="160" alt="Gallery pic 1 of 20 pics" border="0"
src="http://i.foo.net/images/thumb/52/217/217258323.jpg">
</a>
I want to change them like:
<a name="217258323" href="http://i.foo.net/images/full/52/217/217258323.jpg">
<img style="border:1px solid #fff;padding:5px;background:#fff;"
height="120" width="160" alt="Gallery pic 1 of 20 pics" border="0"
src="http://i.foo.net/images/thumb/52/217/217258323.jpg">
</a>
That is, I want replace the link href
with the image src
value -- but with /full/
instead of /thumb/
.
Any sample scripts or examples to achieve what I'm trying to do?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…