logo

scripts

Unnamed repository; edit this file 'description' to name the repository.
commit: 101b209be7f5d69a7562a5449c0c21669e240f86
parent: b3890260b45cae54e72ce58f0929b46575d04a3b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 25 Oct 2017 22:52:25 +0200

javascript/userscript/fix img data-src.js: Initial commit

Diffstat:

javascript/userscript/fix img data-src.js | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/javascript/userscript/fix img data-src.js b/javascript/userscript/fix img data-src.js @@ -0,0 +1,15 @@ +// ==UserScript== +// @name fix img data-src +// @namespace https://hacktivis.me/ +// @description assign data-src attribute to src attribute on images +// @include http://knowyourmeme.com/* +// @version 1.0.0 +// @grant none +// ==/UserScript== + +var input = document.getElementsByTagName("img"); +var src; + +for (i = 0; i < input.length; i++) { + if (src = input[i].getAttribute("data-src")) { input[i].setAttribute("src", src); } +}