There is a problem matching the full image src attribute. The href.match(/\.(jpeg|jpg|gif|png)$/i) does not match urls with get parameters like http://domain.com/image.jpg?getParam=43251.
This is a problem especially in Drupal where a GET param is used to resize images and the url provided by Drupal has always this param at the end (see image_style_url() function).
There is a problem matching the full image src attribute. The
href.match(/\.(jpeg|jpg|gif|png)$/i)
does not match urls with get parameters likehttp://domain.com/image.jpg?getParam=43251
.This is a problem especially in Drupal where a GET param is used to resize images and the url provided by Drupal has always this param at the end (see image_style_url() function).