Occasionally I’ll need to update an image on a page that has some javascript involved. In those cases, rather than saving the image, reloading the page, and then doing whatever interactions I would need to do to get that image to be visible again, here’s a quick tip to get Chrome to reload the image inline.

Right click on the image URL and choose "Edit Attribute"

Right click on the image URL and choose “Edit Attribute”

Inspect the image you want to refresh, right click the ‘src’ attribute and choose ‘Edit Attribute’. Once editing the ‘src’ attribute of the image, simply append a query string (I often just use “?1=2”). If there is already a query string, just append another one (“&1=2”). This will make Chrome reload the image, and you should see whatever changes have been made without having to reload the whole page.

Simple utility function to append a string to a filename. Requires file name/path and string to be appended. Returns full path with new name.

UPDATED 2015-06-23: Justin pointed out a bug that would occur for paths that contained the filename. I’ve updated the function to handle those cases based on a suggestion from him.