Skip to content

Instantly share code, notes, and snippets.

@Veejay
Last active December 12, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Veejay/4696614 to your computer and use it in GitHub Desktop.
Save Veejay/4696614 to your computer and use it in GitHub Desktop.
Workaround for Flickr images "click-to-display"
// Straight DOM / Javascript
// Images are blocked through a data attribute client-side
var targetImages = document.querySelectorAll('img[data-blocked-src]')
// Go through all the blocked images and replace the node with an img element
// using the proper link as its source
for(var i = 0, l = targetImages.length; i < l; i++) {
visibleImage = document.createElement('img');
visibleImage.src = targetImages[i].getAttribute('data-blocked-src');
targetImages[i].parentNode.replaceChild(visibleImage, targetImages[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment