Last active
December 12, 2015 02:09
-
-
Save Veejay/4696614 to your computer and use it in GitHub Desktop.
Workaround for Flickr images "click-to-display"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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