Skip to content

Instantly share code, notes, and snippets.

@a-pasquale
Created March 31, 2017 21:34
Show Gist options
  • Save a-pasquale/e3a63cf2373d3bd9fc47085213284abb to your computer and use it in GitHub Desktop.
Save a-pasquale/e3a63cf2373d3bd9fc47085213284abb to your computer and use it in GitHub Desktop.
UserScript to replace all images with kittens!
// ==UserScript==
// @name Kittens Everywhere!
// @namespace https://holyokecodes.org/
// @version 0.1
// @description Kittens try to take over the world!
// @author Andrew Pasquale
// @match */*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// get all images
var imgs = document.getElementsByTagName("img");
// loop through images
for(var i=0; i<imgs.length; i++) {
// change image source
imgs[i].src='http://cdn3-www.cattime.com/assets/uploads/2011/08/best-kitten-names-1.jpg';
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment