Possible Duplicate:
How to replace image links with img src url in Greasemonkey
I’m new to javacript and want to write a GreaseMonkey script to rewrite certain image links on a website to display the original size images instead of thumbnails.
The image links are in the forms below:
<div class="feed_img"><a onclick="App.scaleImg(this,'7e87e5d5tw1difluxvqlzj');" href="javascript:;"><img src="http://ww3.sinaimg.cn/thumbnail/7e87e5d5tw1difluxvqlzj.jpg" class="imgicon" vimg="1"></a></div>
What I want to do is to replace
http://*/thumbnail/*.jpg
to
http://*/large/*.jpg
Could anyone give me a lead?
You’d have to traverse all of the
<img>tags and just replacethumbnailwithlargein theirsrcattribute:Hopefully this code works. I’m using a basic
replace(), so if you’d like to try regex, I think it should work too.