Created
October 8, 2010 12:27
-
-
Save NV/616701 to your computer and use it in GitHub Desktop.
UserJS: Bugzilla attachments preview
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
// ==UserScript== | |
// @name Bugzilla attachments preview | |
// @namespace http://userscripts.ru/js/bugzilla-attachments-preview/ | |
// @include https://bugs.webkit.org/* | |
// @include https://bugzilla.mozilla.org/* | |
// @description Shows attached images | |
// @copyright 2010+, Nikita Vasilyev | |
// @version 1.0 | |
// @licence MIT | |
// ==/UserScript== | |
[].forEach.call(document.querySelectorAll("#attachment_table .bz_attach_extra_info"), function(a){ | |
if (a.textContent.indexOf("image/") > -1) { | |
var img = new Image(); | |
img.style.display = "block"; | |
img.src = a.previousElementSibling.href; | |
a.parentNode.insertBefore(img, a.parentNode.firstChild); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment