// ==UserScript== // @name BBS Post Link Previews // @namespace dollars-bbs.org // @author Degritone // @description Allows you to hover over a >> link for a preview of the post // @match *://*.dollars-bbs.org/* // @grant none // ==/UserScript== function request(url){ let xmlHttp = new XMLHttpRequest(); xmlHttp.open("GET",url,false); xmlHttp.send(null); return xmlHttp.responseText; } function work(){ let replies = document.getElementsByClassName("replytext"); if(!replies){ setTimeout(work,100); return; } setTimeout(work,500); for(let i=0;i0){ let imgdiv = document.createElement("div"); post.getElementsByTagName("h3")[0].after(imgdiv); imgdiv.appendChild(post.getElementsByTagName("img")[0].parentNode); imgdiv.style.margin = "auto"; imgdiv.style.width = "500px"; imgdiv.style.border = "1px solid #EEEEEE"; } let as = post.getElementsByClassName("replytext")[0].getElementsByTagName("a"); for(let i=0;i=parseInt(post.style.maxHeight.replace("px","")))?15:0); post.style.width = width+"px"; post.style.right = "1px"; post.style.top = ""+((window.innerHeight-post.offsetHeight)/2+1)+"px"; post.addEventListener("mouseup",(e)=>{e.stopPropagation();}); } function remove(){ while(document.getElementById("previewPost")) document.getElementById("previewPost").parentNode.removeChild(document.getElementById("previewPost")); } work(); document.addEventListener("mouseup",remove,false);