Last active
January 27, 2016 21:23
-
-
Save gusridd/28210f77b893d231c0b9 to your computer and use it in GitHub Desktop.
Change current web page images by photos of Nicolas Cage
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
// Get all images | |
var images = document.getElementsByTagName('img'); | |
for (var i in images){ | |
var img = images[i]; | |
var height = img.height; | |
var width = img.width; | |
var url = "https://www.placecage.com/c/" + width + "/" + height; | |
// Replace an image src by the corresponding placecage url | |
img.setAttribute('src', url); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment