From d8b0212b8fa99ebe4d620a04e55ec6dbc3595aca Mon Sep 17 00:00:00 2001 From: coomdev Date: Wed, 29 Dec 2021 07:55:54 +0100 Subject: [PATCH] rebuild --- main.user.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/main.user.js b/main.user.js index 020b563..5506d1c 100644 --- a/main.user.js +++ b/main.user.js @@ -7003,7 +7003,7 @@ var IEND = import_buffer2.Buffer.from("IEND"); var tEXt = import_buffer2.Buffer.from("tEXt"); var CUM0 = import_buffer2.Buffer.from("CUM\x000"); - var xmlhttprequest = GM_xmlhttpRequest ? GM_xmlhttpRequest : GM ? GM.xmlHttpRequest : GM_xmlhttpRequest; + var xmlhttprequest = typeof GM_xmlhttpRequest != "undefined" ? GM_xmlhttpRequest : GM ? GM.xmlHttpRequest : GM_xmlhttpRequest; function GM_fetch(...[url, opt]) { function blobTo(to, blob) { if (to == "arrayBuffer" && blob.arrayBuffer) @@ -7107,8 +7107,10 @@ if (!res) return; let fi = post.querySelector(".file-info"); - let a = document.createElement("a"); - a.className = "fa fa-eye"; + let cf = ` + + `; + let a = document.createRange().createContextualFragment(cf).children[0]; let type = await fileTypeFromBuffer(res.data); let cont; let w, h; @@ -7131,10 +7133,6 @@ h = cont.height; } let contract = () => { - cont.style.width = "auto"; - cont.style.height = "auto"; - cont.style.maxWidth = "125px"; - cont.style.maxHeight = "125px"; }; let expand = () => { cont.style.width = `${w}px`; @@ -7248,6 +7246,18 @@ }); }; document.addEventListener("4chanXInitFinished", startup); + var customStyles = document.createElement("style"); + customStyles.appendChild(document.createTextNode(` +.extractedImg { + width:auto; + height:auto; + max-width:125px; + max-height:125px; + cursor: pointer; + +} +`)); + document.documentElement.insertBefore(customStyles, null); })(); /*! * The buffer module from node.js, for the browser.