imgur album browser script - firefox-fix-web - Firefox extension: fix web | |
git clone git://git.codemadness.org/firefox-fix-web | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 5f5e6c2069ed391a0a1eeb7ab264cf88220f86a1 | |
parent ff6892788a0e16a4729e66ffeaf32df2f87f9b5a | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Mon, 25 Feb 2019 20:33:20 +0100 | |
imgur album browser script | |
Diffstat: | |
M extension/manifest.json | 4 ++++ | |
A extension/site/imgur.js | 16 ++++++++++++++++ | |
2 files changed, 20 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/extension/manifest.json b/extension/manifest.json | |
@@ -57,6 +57,10 @@ | |
"matches": [ "*://*.hardware.info/*" ], | |
"css": [ "site/hardwareinfo.css" ], | |
"js": [ "site/hardwareinfo.js" ] | |
+ }, | |
+ { | |
+ "matches": [ "*://imgur.com/*" ], | |
+ "js": [ "site/imgur.js" ] | |
} | |
] | |
} | |
diff --git a/extension/site/imgur.js b/extension/site/imgur.js | |
@@ -0,0 +1,16 @@ | |
+(function() { | |
+ // not an album page. | |
+ if (!document.querySelectorAll("div.post-header").length) | |
+ return; | |
+ | |
+ var els = Array.from(document.querySelectorAll("div.post-image-contain… | |
+ var html = ""; | |
+ for (var i = 0; i < els.length; i++) { | |
+ var id = els[i].getAttribute("id") || ""; | |
+ if (!id.length) | |
+ continue; | |
+ var url = "https://i.imgur.com/" + id + ".jpg"; | |
+ html += "<a href=\"" + url + "\"><img src=\"" + url + "\" alt=… | |
+ } | |
+ document.body.innerHTML = html; | |
+})(); |