NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name GameFAQs Avatars // @namespace https://gamefaqs.gamespot.com/ // @version 0.4 // @description Shows user icon next to posts on GameFAQs // @license MIT // @author Kraust (Judgmenl) // @match https://gamefaqs.gamespot.com/boards/* // @match https://gamefaqs.gamespot.com/boards/*/* // @exclude https://gamefaqs.gamespot.com/boards/*/*/* // @grant none // @updateURL https://openuserjs.org/meta/Kraust/GameFAQs_Avatars.meta.js // ==/UserScript== function topicList() { var msgs = document.getElementsByClassName("tauthor"); console.log("HELLO:" + msgs); for (var msg of msgs) { if (msg === null) { continue; } else if (msg.innerText === "Created By") { continue; } var user = msg.querySelectorAll('a')[0].innerText; var div = document.createElement('div'); div.classList.add("img"); var av = document.createElement('img'); // av.classList.add("imgboxart"); av.alt = ""; av.src = "/a/avatar/" + user + ".jpg"; av.style = "max-width: 10%; float: left;"; div.append(av); msg.prepend(div); } } function messageList() { var msgs = document.getElementsByClassName("msg_infobox"); for (var msg of msgs) { if (msg === null) { continue; } if (msg.querySelector('.img') !== null) { continue; } var menu = msg.querySelector(".menu_toggle"); if (menu === null) { continue; } var user = menu.getAttribute("data-username"); var div = document.createElement('div'); div.classList.add("img"); var av = document.createElement('img'); av.classList.add("imgboxart"); av.alt = ""; av.src = "/a/avatar/" + user + ".jpg"; div.append(av); msg.append(div); } } (function () { topicList(); messageList(); })();