Skip to content

Instantly share code, notes, and snippets.

@Veejay Veejay/workaround.js
Last active Dec 12, 2015

What would you like to do?
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
You can’t perform that action at this time.