From 1df5385e08dcb17e4cfdb13235f5b92fa6bf124f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 24 Aug 2020 15:44:52 +0300 Subject: [PATCH] Atlas Obscura --- atlas_obscura.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 atlas_obscura.js diff --git a/atlas_obscura.js b/atlas_obscura.js new file mode 100644 index 0000000..6d1c252 --- /dev/null +++ b/atlas_obscura.js @@ -0,0 +1,18 @@ +// ==UserScript== +// @name Atlas Obscura Image Fixer +// @version 1 +// @grant none +// @match https://www.atlasobscura.com/* +// ==/UserScript== + +function fixImages() { + for (let img of document.getElementsByTagName('img')) { + let imgUrl = img.getAttribute('data-src'); + if (imgUrl) { + img.setAttribute('src', imgUrl); + img.style.height = 'auto'; + } + } +} + +fixImages();