您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
[케인 팬카페 전용]
当前为
// ==UserScript== // @name [케인] 댓글사진확대 + 글씨확대 + 트게더스킨 // @namespace https://cafe.naver.com/kanetv // @version 5.6 // @description [케인 팬카페 전용] // @author 돈통 // @match https://cafe.naver.com/kanetv* // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAACTSURBVDhPY6AUMEJpDFCs/fU/lIkCeq9yo+jBagCxmkGACUrDAS7NuACGAbgANttBAEOw+Lket7E4Jw+UyxDFdPIllIkVgA0g1dkg0Ds3TZbBYukTsg0Agz2WPESHATKAh4fL8S9kGcBwIloGyiI/DEAA5BJ4LJBqCMwbJBuAnh5QOIQMwZaYMARwGYJNMxUAAwMAWZQyUi84O4wAAAAASUVORK5CYII= // @grant GM_getValue // @grant GM_addStyle // @grant GM_setValue // @grant GM_registerMenuCommand // @require https://code.jquery.com/jquery-3.6.0.min.js // @license MIT // ==/UserScript== var numver = 5.6; var comnum=0; var a = 0; var b = 0; var z = 0; var buttonadd = 0; var stop = 0; var newnum = 0; let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; let observerinki = new MutationObserver(e => { console.log("inki detected!!"); setTimeout(function(){ var inkilistpage ; try{ inkilistpage = document.getElementsByClassName("cafe-menu-list")[1].getElementsByTagName("li")[1].getElementsByTagName("a")[0].className; }catch{ try{ inkilistpage = document.getElementsByClassName("cafe-menu-list")[0].getElementsByTagName("li")[1].getElementsByTagName("a")[0].className; }catch{};}; console.log(inkilistpage); if((GM_getValue("tgdskin") == true || GM_getValue("star") == true) && inkilistpage == "gm-tcol-c b") inkilist(); if(inkilistpage != "gm-tcol-c b") addbutton(); if(stop==1) return 0; let cn = Number(document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('button_comment')[0].getElementsByClassName('num')[0].innerHTML); console.log(cn); var pages = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("btn_register is_active") var pagesnum = pages.length; for(let idx=0; idx<pagesnum; idx++){ console.log(pages[idx].classList); if(pages[idx].classList.contains('eventlistening')) continue; pages[idx].classList.add('eventlistening'); pages[idx].addEventListener("click", async function(){ console.log("댓글 수정/등록됨"); if(stop==1) return 0; await sleep(500); let a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); //console.log(a) var waittime = 0 a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ //console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); //console.log(waittime); setTimeout(function(){ a.forEach((element) => { if(element.firstChild.currentSrc.includes("_gif")==true){element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375_gif","");} if(element.firstChild.src.includes("_gif")==true){element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375_gif","");} element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375",""); element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375",""); //console.log(element.firstChild.outerHTML); });},waittime); console.log("enlarge picture"); }, false); } if(comnum == cn){ if (document.getElementById("Enlarge_button") != null){ console.log("안늘립니다. skip"); return; } } window.setTimeout(function(){ a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); //console.log(a) comnum = cn; var waittime = 0 a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ //console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); //console.log(waittime); setTimeout(function(){ a.forEach((element) => { if(element.firstChild.currentSrc.includes("_gif")==true){element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375_gif","");} if(element.firstChild.src.includes("_gif")==true){element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375_gif","");} element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375",""); element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375",""); //console.log(element.firstChild.src); });},waittime); console.log("enlarge picture"); },100); },100); }); let observer = new MutationObserver(e => { console.log("detected!!"); if(stop==1) return 0; let cn = Number(document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('button_comment')[0].getElementsByClassName('num')[0].innerHTML); console.log(cn); console.log(comnum); var pages = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("btn_register is_active") var pagesnum = pages.length; for(let idx=0; idx<pagesnum; idx++){ console.log(pages[idx].classList); if(pages[idx].classList.contains('eventlistening')) continue; pages[idx].classList.add('eventlistening'); pages[idx].addEventListener("click", async function(){ console.log("댓글 수정/등록됨"); if(stop==1) return 0; await sleep(500); let a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); //console.log(a) var waittime = 0 a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ //console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); //console.log(waittime); setTimeout(function(){ a.forEach((element) => { if(element.firstChild.currentSrc.includes("_gif")==true){element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375_gif","");} if(element.firstChild.src.includes("_gif")==true){element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375_gif","");} element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375",""); element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375",""); //console.log(element.firstChild.outerHTML); });},waittime); console.log("enlarge picture"); }, false); } if(comnum == cn){ return; } window.setTimeout(function(){ a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); //console.log(a) comnum = cn; var waittime = 0 a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ //console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); //console.log(waittime); setTimeout(function(){ a.forEach((element) => { if(element.firstChild.currentSrc.includes("_gif")==true){element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375_gif","");} if(element.firstChild.src.includes("_gif")==true){element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375_gif","");} element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375",""); element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375",""); //console.log(element.firstChild.src); });},waittime); console.log("enlarge picture"); },100); }); function sleep(sec) { return new Promise(resolve => setTimeout(resolve, sec)); } function addObserverIfDesiredNodeAvailable() { console.log("try observe"); //const composeBox = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('CommentBox'); const composeBox = document.getElementsByClassName("cafe-menu-list"); if(!composeBox[1]) { window.setTimeout(addObserverIfDesiredNodeAvailable,500); return; } console.log("found it!") console.log(composeBox[1]); observer.observe(document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('CommentBox')[0], {childList: true, subtree: true, characterData: true}); try{ observerinki.observe(document.getElementsByClassName("cafe-menu-list")[1].getElementsByTagName("li")[1].getElementsByTagName("a")[0], {childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ['class']}); }catch{ try{ observerinki.observe(document.getElementsByClassName("cafe-menu-list")[0].getElementsByTagName("li")[1].getElementsByTagName("a")[0], {childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ['class']}); }catch{}}; console.log("ok1"); } async function getcommentlist(){ return new Promise((resolve, reject) => { console.log("wait until loaded"); var intv0 = setInterval(function() { try{ var elems = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.ArticleLoading'); }catch{return false;} //console.log('.ArticleLoading') if(elems.length > 0){ return false } //when element is found, clear the interval. console.log("loaded"); clearInterval(intv0); console.log("finding element..."); var intvf = setInterval(function() { try{ var elems = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('button_comment')[0].getElementsByClassName('num')[0].innerHTML; }catch{return false;} //when element is found, clear the interval. console.log("element is found"); clearInterval(intvf); clearInterval(intv0); resolve(true); }, 100); }, 100); }); } async function addiconstar(){ try{ let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board.m-tcol-c")[1].getElementsByClassName("inner_list") let e; var bestcut = 0; try{ //console.log("!111@@@@@@@@"); e = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board.m-tcol-c")[1].getElementsByClassName("td_likes"); if(e.length != 0) bestcut = 10; }catch{} if(bestcut==0){ try{ //console.log("2222@@@@@@@@"); e = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board.m-tcol-c")[1].getElementsByClassName("td_view"); bestcut = 350; }catch{} } newnum = d.length //console.log(d); //ggggg = newnum; //console.log(ggggg); var likenum = e.length; var likesnumber = 0; //console.log(e); for(let idx=0; idx<newnum; idx++){ let nnum = d[idx].childNodes.length; let ot = 0; let om = 0; let ir = 1000; let mr = 1000; //console.log("@@@@@@@"); //console.log("@@@@@@@"); if(bestcut != 10){ //console.log("@@@@@@@"); var cmtnum = 0; try{ cmtnum = Number(d[idx].getElementsByClassName("cmt")[0].innerText.replace(/\[|\]/g,"")); }catch{}; likesnumber = Number(e[idx].innerText) + cmtnum * 25; //console.log(likesnumber); } else likesnumber = Number(e[idx].innerText); //console.log("@@@@@@@"); for(let idxx=0; idxx<nnum; idxx++){ if(d[idx].childNodes[idxx].className == "list-i-img"){ //d[idx].prepend(d[idx].childNodes[idxx]); ot+=1; ir = idxx; } if(d[idx].childNodes[idxx].className == "list-i-movie"){ //d[idx].prepend(d[idx].childNodes[idxx]); om+=1; mr = idxx; } } //console.log("@@@@@@@"); if(GM_getValue('tgdskin') == true && mr!=1000){ d[idx].removeChild(d[idx].childNodes[mr]); } if(GM_getValue('tgdskin') == true && ir!=1000){ d[idx].removeChild(d[idx].childNodes[ir]); } if((GM_getValue('star') == true || GM_getValue('tgdskin') == true ) && likenum !=0 && likesnumber>=bestcut){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/star.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].prepend(z); } else if(GM_getValue('tgdskin') == true && om>0){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/video.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].prepend(z); } else if(GM_getValue('tgdskin') == true && ot>0){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/image_green.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].prepend(z); } else if(GM_getValue('tgdskin') == true){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].prepend(z); } }}catch{} try{ let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board.m-tcol-c")[0].getElementsByClassName("td_article"); //console.log(d); newnum = d.length //console.log(newnum); for(let idx=0; idx<newnum; idx++){ let nnum = d[idx].childNodes.length; let ot = 0; let om = 0; for(let idxx=0; idxx<nnum; idxx++){ if(d[idx].childNodes[idxx].className == "board-tag"){ if(d[idx].childNodes[idxx].innerText == "공지"){ ot+=1; } if(d[idx].childNodes[idxx].innerText == "추천"){ om+=1; } } if(GM_getValue('tgdskin') == true && ot>0 && d[idx].childNodes[idxx].className == "board-list"){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/info.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].childNodes[idxx].childNodes[1].prepend(z); } if( (GM_getValue('star') == true || GM_getValue('tgdskin') == true ) && om>0 && d[idx].childNodes[idxx].className == "board-list"){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/star.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].childNodes[idxx].childNodes[1].prepend(z); } } }}catch{} } async function boldlist(){ //let d = document.getElementsByClassName("cafe-menu-list")[1].getElementsByTagName("li")[1].getElementsByTagName("a")[0].className == "gm-tcol-c b" let d = document.getElementsByClassName("cafe-menu-list") //console.log(d); var dnewnum = d.length; //console.log(newnum); for(let idx=0; idx<dnewnum; idx++){ let e = d[idx].getElementsByTagName("li"); var dnewnumm = e.length; for(let idxx=0; idxx<dnewnumm; idxx++){ try{ let cname = e[idxx].getElementsByTagName("a")[0].className; let ctext = e[idxx].getElementsByTagName("a")[0].innerText; //console.log(cname); //console.log(ctext); if(e[idxx].getElementsByTagName("a")[0].className == "gm-tcol-c b"){ console.log(ctext); return e[idxx].getElementsByTagName("a")[0].innerText; } }catch{}; } } console.log("none"); return "none"; } async function addbutton(){ await console.log("버튼넣는중"); var bolddd = await boldlist(); if(bolddd!="none" && bolddd!="전체글보기"&& bolddd!="인기글"){ var intchecking = await setInterval(async function() { console.log("trying"); try{ if ( comnum == 0 || comnum == "0" || document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('comment_refresh_button')[0].id == "hey"){ console.log("버튼 이미있음/댓글 없음"); clearInterval(intchecking); return 0; } }catch{}; }, 500); var btn; var btn2; var vernum; var intve = await setInterval(async function() { try{ var target = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('comment_tab')[0]; if (await document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('comment_refresh_button')[0].id == "hey"){ console.log("버튼 이미있음"); clearInterval(intve); return 0; } document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('comment_refresh_button')[0].id = "hey"; btn = document.createElement("button"); btn.style.cssText = `color: white; padding: 2px; text-align: center; width: 50px; background-color: crimson; border-radius: 5px; margin-left: 10px; font-size: 12px; text-decoration: none; cursor: pointer;` btn.innerText = `확대OFF` btn.target = "_blank" btn.role = "button" btn.className = "Enlarge_button" btn.onclick = () => { console.log("확대 재시작"); target.removeChild(btn); target.appendChild(btn2); stop = 0; document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("comment_refresh_button")[0].click(); }; btn2 = document.createElement("button"); btn2.style.cssText = `color: white; padding: 2px; text-align: center; width: 50px; background-color: green; border-radius: 5px; margin-left: 10px; font-size: 12px; text-decoration: none; cursor: pointer;` btn2.innerText = `확대ON` btn2.target = "_blank" btn2.role = "button" btn2.className = "Enlarge_button" btn2.onclick = () => { console.log("확대 중지"); target.removeChild(btn2); target.appendChild(btn); stop = 1; document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("comment_refresh_button")[0].click(); }; try{ var targetver = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('CommentCleanBot cleanbot')[0]; vernum = document.createElement("div"); vernum.style.cssText = `color: black; margin-left: 10px; font-size: 10px; font-weight: 200; text-decoration: none;` vernum.innerText = `Ver`+numver; vernum.target = "_blank" }catch{}; //console.log("made on off button"); }catch{ return false;} try{ console.log("check"); if(stop == 1) target.appendChild(btn); else target.appendChild(btn2); targetver.appendChild(vernum); }catch{ return false; } //console.log("made on off button"); //when element is found, clear the interval. console.log("added on off button"); clearInterval(intve); }, 100); var intve2 = await setInterval(await function() { try{ document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("comment_refresh_button")[0].addEventListener("click", async function(){ console.log("새로고침 됨"); if(stop==1){ console.log("확대안해"); let a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); var waittime = 0 a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ //console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); //console.log(waittime); setTimeout(function(){ a.forEach((element) => { //if(element.firstChild.currentSrc.includes("?type=mc250_375")==false){ //element.firstChild.currentSrc = element.firstChild.currentSrc + "?type=mc250_375";} //if(element.firstChild.src.includes("?type=mc250_375")==false){ //element.firstChild.src = element.firstChild.src + "?type=mc250_375";} });},waittime); console.log("shrink picture"); //console.log(a); return 0; } await sleep(500); let a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); waittime = 0 a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); //console.log(a); //console.log(waittime); setTimeout(function(){ a.forEach((element) => { if(element.firstChild.currentSrc.includes("_gif")==true){element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375_gif","");} if(element.firstChild.src.includes("_gif")==true){element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375_gif","");} element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375",""); element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375",""); //console.log(element.firstChild.src); });},waittime); console.log("enlarge picture"); //console.log(a); }, false); }catch{return false;} //when element is found, clear the interval. //console.log("added refresh func"); clearInterval(intve2); }, 100); var intve3 = await setInterval(await function() { try{ document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("comment_tab_button")[0].addEventListener("click", async function(){ console.log("새로고침 됨"); if(stop==1) return 0; await sleep(500); let a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); var waittime = 0 a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ //console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); //console.log(waittime); setTimeout(function(){ a.forEach((element) => { if(element.firstChild.currentSrc.includes("_gif")==true){element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375_gif","");} if(element.firstChild.src.includes("_gif")==true){element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375_gif","");} element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375",""); element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375",""); //console.log(element.firstChild.outerHTML); });},waittime); console.log("enlarge picture"); }, false); }catch{return false;} //when element is found, clear the interval. //console.log("added tab 0 func"); clearInterval(intve3); }, 100); var intve4 = await setInterval(await function() { try{ document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("comment_tab_button")[1].addEventListener("click", async function(){ console.log("새로고침 됨"); if(stop==1) return 0; await sleep(500); let a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); var waittime = 0 a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ //console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); //console.log(waittime); setTimeout(function(){ a.forEach((element) => { if(element.firstChild.currentSrc.includes("_gif")==true){element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375_gif","");} if(element.firstChild.src.includes("_gif")==true){element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375_gif","");} element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375",""); element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375",""); //console.log(element.firstChild.outerHTML); });},waittime); console.log("enlarge picture"); }, false); }catch{return false;} //when element is found, clear the interval. //console.log("added tab 1 func"); clearInterval(intve4); }, 100); var intve5 = await setInterval(await function() { try{ var pages = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("btn number") var pagesnum = pages.length; for(let idx=0; idx<pagesnum; idx++){ pages[idx].addEventListener("click", async function(){ console.log("새로고침 됨"); if(stop==1) return 0; await sleep(500); let a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); var waittime = 0 a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ //console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); //console.log(waittime); setTimeout(function(){ a.forEach((element) => { if(element.firstChild.currentSrc.includes("_gif")==true){element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375_gif","");} if(element.firstChild.src.includes("_gif")==true){element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375_gif","");} element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375",""); element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375",""); //console.log(element.firstChild.outerHTML); });},waittime); console.log("enlarge picture"); }, false); } }catch{return false;} //when element is found, clear the interval. //console.log("added number func"); clearInterval(intve5); }, 100); if(GM_getValue('tgdskin', true) && GM_getValue('choo', true)){ //console.log("ddddddddddddddddddddd"); GM_setValue('choo', false); setTimeout(async function(){ //let g = await ifDesiredNodeAvailable("u_txt _label"); let g = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("u_txt _label"); console.log(g); g[0].innerText = "추천"; g[0].outerText = "추천"; },10) GM_setValue('choo', true); } if(GM_getValue('bestcom',true)){ await bestcomment(); } } } (function() { 'use strict'; var css = document.createElement('style'); var head = document.head; css.type = 'text/css'; css.innerText = `* { -webkit-user-select: text !important; -moz-user-select: text !important; -ms-user-select: text !important; user-select: text !important; }`; function main() { var doc = document; var body = document.body; var docEvents = [ doc.oncontextmenu = null, doc.onselectstart = null, doc.ondragstart = null, doc.onmousedown = null ]; var bodyEvents = [ body.oncontextmenu = null, body.onselectstart = null, body.ondragstart = null, body.onmousedown = null, body.oncut = null, body.oncopy = null, body.onpaste = null ]; [].forEach.call( ['copy', 'cut', 'paste', 'select', 'selectstart'], function(event) { document.addEventListener(event, function(e) { e.stopPropagation(); }, true); } ); alwaysAbsoluteMode(); enableCommandMenu(); head.appendChild(css); document.addEventListener('keydown', keyPress); } function keyPress(event) { if (event.ctrlKey && event.keyCode == 192) { return confirm('Activate Absolute Right Click Mode!') == true ? absoluteMode() : null; } } function absoluteMode() { [].forEach.call( ['contextmenu', 'copy', 'cut', 'paste', 'mouseup', 'mousedown', 'keyup', 'keydown', 'drag', 'dragstart', 'select', 'selectstart'], function(event) { document.addEventListener(event, function(e) { e.stopPropagation(); }, true); } ); } function alwaysAbsoluteMode() { let sites = ['example.com','www.example.com']; const list = RegExp(sites.join('|')).exec(location.hostname); return list ? absoluteMode() : null; } var blackList = [ 'youtube.com','.google.','.google.com','greasyfork.org','twitter.com','instagram.com','facebook.com','translate.google.com','.amazon.','.ebay.','github.','stackoverflow.com', 'bing.com','live.com','.microsoft.com','dropbox.com','pcloud.com','box.com','sync.com','onedrive.com','mail.ru','deviantart.com','pastebin.com', 'dailymotion.com','twitch.tv','spotify.com','steam.com','steampowered.com','gitlab.com','.reddit.com' ] var enabled = false; var url = window.location.hostname; var match = RegExp(blackList.join('|')).exec(url); if (window && typeof window != undefined && head != undefined) { if (!match && enabled != true) { main(); enabled = true //console.log(location.hostname); window.addEventListener('contextmenu', function contextmenu(event) { event.stopPropagation(); event.stopImmediatePropagation(); var handler = new eventHandler(event); window.removeEventListener(event.type, contextmenu, true); var eventsCallBack = new eventsCall(function() {}); handler.fire(); window.addEventListener(event.type, contextmenu, true); if (handler.isCanceled && (eventsCallBack.isCalled)) { event.preventDefault(); } }, true); } function eventsCall() { this.events = ['DOMAttrModified', 'DOMNodeInserted', 'DOMNodeRemoved', 'DOMCharacterDataModified', 'DOMSubtreeModified']; this.bind(); } eventsCall.prototype.bind = function() { this.events.forEach(function (event) { document.addEventListener(event, this, true); }.bind(this)); }; eventsCall.prototype.handleEvent = function() { this.isCalled = true; }; eventsCall.prototype.unbind = function() { this.events.forEach(function (event) {}.bind(this)); }; function eventHandler(event) { this.event = event; this.contextmenuEvent = this.createEvent(this.event.type); } eventHandler.prototype.createEvent = function(type) { var target = this.event.target; var event = target.ownerDocument.createEvent('MouseEvents'); event.initMouseEvent( type, this.event.bubbles, this.event.cancelable, target.ownerDocument.defaultView, this.event.detail, this.event.screenX, this.event.screenY, this.event.clientX, this.event.clientY, this.event.ctrlKey, this.event.altKey, this.event.shiftKey, this.event.metaKey, this.event.button, this.event.relatedTarget ); return event; }; eventHandler.prototype.fire = function() { var target = this.event.target; var contextmenuHandler = function(event) { event.preventDefault(); }.bind(this); target.dispatchEvent(this.contextmenuEvent); this.isCanceled = this.contextmenuEvent.defaultPrevented; }; } })(); function enableCommandMenu() { var commandMenu = true; try { if (typeof(GM_registerMenuCommand) == undefined) { return; } else { if (commandMenu == true ) { if(GM_getValue('tgdskin', 5)==5) GM_setValue('tgdskin',false); if(GM_getValue('tgdskin', true)==true){ GM_registerMenuCommand('트게더 스킨 끄기 [현재: ON]', function() { GM_setValue('tgdskin', false); location.reload(); }) } else{ GM_registerMenuCommand('트게더 스킨 켜기 [현재: OFF]', function() { GM_setValue('tgdskin', true); location.reload(); }) } if(GM_getValue('star', 5)==5) GM_setValue('star',true); if(GM_getValue('star')==true && GM_getValue('tgdskin', true)== false){ GM_registerMenuCommand('인기 게시글 별표 표시 끄기 [현재: 켜짐]', function() { GM_setValue('star',false); location.reload(); }) } if(GM_getValue('star')==false && GM_getValue('tgdskin', true)== false){ GM_registerMenuCommand('인기 게시글 별표 표시 켜기 [현재: 꺼짐]', function() { GM_setValue('star',true); location.reload(); }) } if(GM_getValue('bestcom', 5)==5) GM_setValue('bestcom',true); if(GM_getValue('bestcom')==true){ GM_registerMenuCommand('베스트 댓글 끄기 [현재: 켜짐]', function() { GM_setValue('bestcom',false); location.reload(); }) } if(GM_getValue('bestcom')==false){ GM_registerMenuCommand('베스트 댓글 켜기 [현재: 꺼짐]', function() { GM_setValue('bestcom',true); location.reload(); }) } if(GM_getValue('memlevel', 5)==5) GM_setValue('memlevel',true); if(GM_getValue('memlevel')==true){ GM_registerMenuCommand('회원 등급 표시 끄기 [현재: 켜짐]', function() { GM_setValue('memlevel',false); location.reload(); }) } if(GM_getValue('memlevel')==false){ GM_registerMenuCommand('회원 등급 표시 켜기 [현재: 꺼짐]', function() { GM_setValue('memlevel',true); location.reload(); }) } if(GM_getValue('largetext15', 5)==5) GM_setValue('largetext15',false); if(GM_getValue('largetext14.5', 5)==5) GM_setValue('largetext14.5',true); if(GM_getValue('largetext14', 5)==5) GM_setValue('largetext14',false); if(GM_getValue('fontsize', 5)==5) GM_setValue('fontsize',14.5); if(GM_getValue('largetext15', true)==true){ GM_registerMenuCommand('글씨 확대 끄기 [현재: 15px]', function() { GM_setValue('largetext15', false); GM_setValue('largetext14.5', false); GM_setValue('largetext14', false); GM_setValue('fontsize', 0); location.reload(); }) } if(GM_getValue('largetext14', true)==true){ GM_registerMenuCommand('글씨 확대 끄기 [현재: 14px]', function() { GM_setValue('largetext15', false); GM_setValue('largetext14.5', false); GM_setValue('largetext14', false); GM_setValue('fontsize', 0); location.reload(); }) } if(GM_getValue('largetext14.5', true)==true){ GM_registerMenuCommand('글씨 확대 끄기 [현재: 14.5px]', function() { GM_setValue('largetext15', false); GM_setValue('largetext14.5', false); GM_setValue('largetext14', false); GM_setValue('fontsize', 0); location.reload(); }) } GM_registerMenuCommand('글씨 확대 14px로', function() { GM_setValue('largetext15', false); GM_setValue('largetext14.5', false); GM_setValue('largetext14', true); GM_setValue('fontsize',14); location.reload(); }) GM_registerMenuCommand('글씨 확대 14.5px로', function() { GM_setValue('largetext15', false); GM_setValue('largetext14.5', true); GM_setValue('largetext14', false); GM_setValue('fontsize',14.5); location.reload(); }) GM_registerMenuCommand('글씨 확대 15px로', function() { GM_setValue('largetext15', true); GM_setValue('largetext14.5', false); GM_setValue('largetext14', false); GM_setValue('fontsize',15); location.reload(); }) }; } } catch(err) { console.log(err); } } async function inkilist(){ try{ setTimeout(function(){ //console.log(document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board")[0].childNodes[0].getElementsByClassName("inner_list")) try{ let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board")[0].getElementsByClassName("inner_list"); var waitinki = 100; //if(newnum==0) waitinki = 1500; console.log(d); let e; var bestcut = 10000; try{ //console.log("2222@@@@@@@@"); setTimeout(function(){ e = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board")[0].getElementsByClassName("td_view"); console.log(e.length); bestcut = 350; if(e.length==0) waitinki = 1000; },100); }catch{} setTimeout(function(){ var likenum = e.length; var likesnumber = 0; //console.log("add!!!!!!!!!"); var newnum = d.length //console.log(newnum); for(let idx=0; idx<newnum; idx++){ //console.log("add!!!!!!!!!"); try{ //console.log("add!!!!!!!!!"); var cmtnum = Number(d[idx].getElementsByClassName("cmt")[0].innerText.replace(/\[|\]/g,"")); if(d[idx].id=="iconadded") continue; d[idx].id="iconadded"; if(likenum != 0){ likesnumber = Number(e[idx].innerText) + cmtnum * 25; console.log(likesnumber); } if((GM_getValue('star') == true || GM_getValue('tgdskin') == true ) && likenum !=0 && likesnumber>=bestcut){ //console.log("add!!!!!!!!!"); let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/star.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].childNodes[0].prepend(z); } else{ let svgicon = d[idx].childNodes[2].getElementsByTagName("svg")[0].className.baseVal; let ot = 0; let om = 0; let ir = 1000; let mr = 1000; //console.log(svgicon) //console.log("add!!!!!!!!!"); //console.log("add!!!!!!!!!"); if(svgicon == "svg-icon list_attach_img"){ //console.log("adding img") //d[idx].prepend(d[idx].childNodes[idxx]); ot+=1; } //console.log("add!!!!!!!!!"); if(svgicon == "svg-icon list_attach_video"){ //d[idx].prepend(d[idx].childNodes[idxx]); om+=1; } if(GM_getValue('tgdskin') == true && om>0){ //d[idx].childNodes[0].getElementsByTagName("svg")[0].remove(); let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/video.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].childNodes[0].prepend(z); } else if(GM_getValue('tgdskin') == true && ot>0){ //d[idx].childNodes[0].getElementsByTagName("svg")[0].remove(); let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/image_green.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px; padding-right: 2px"; d[idx].childNodes[0].prepend(z); } else if(GM_getValue('tgdskin') == true){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px; padding-right: 2px"; d[idx].childNodes[0].prepend(z); } } }catch{ if(GM_getValue('tgdskin') == true){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px; padding-right: 2px"; d[idx].childNodes[0].prepend(z); } continue; } } }, waitinki) }catch{} },100) setTimeout(function(){ try{ for(let iii=0; iii<12; iii++){ console.log("글목록 버튼.."); //console.log(document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("paginate_area")[0].getElementsByClassName("ArticlePaginate")[0].getElementsByClassName("btn")); document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("paginate_area")[0].getElementsByClassName("ArticlePaginate")[0].getElementsByClassName("btn")[iii].addEventListener("click", async function(){ console.log("button!!"); //console.log(GM_getValue("inkiiconadd", false)); setTimeout(function(){ //console.log(document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board")[0].childNodes[0].getElementsByClassName("inner_list")) let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board")[0].childNodes[0].getElementsByClassName("inner_list"); newnum = d.length //console.log(newnum); var waitinki = 100; if(newnum==0) waitinki = 900; console.log(d) let e; var bestcut = 10000; try{ console.log("2222@@@@@@@@"); e = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("article-board")[0].getElementsByClassName("td_view"); console.log(e); bestcut = 350; if(e.length==0) waitinki = 1200; }catch{} setTimeout(function(){ var likenum = e.length; var likesnumber = 0; for(let idx=0; idx<newnum; idx++){ try{ if(d[idx].id=="iconadded") continue; d[idx].id="iconadded"; var cmtnum = Number(d[idx].getElementsByClassName("cmt")[0].innerText.replace(/\[|\]/g,"")); if(likenum != 0){ likesnumber = Number(e[idx].innerText) + cmtnum * 25; console.log(likesnumber); } if((GM_getValue('star') == true || GM_getValue('tgdskin') == true ) && likenum !=0 && likesnumber>=bestcut){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/star.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].childNodes[0].prepend(z); } else{ let svgicon = d[idx].childNodes[2].getElementsByTagName("svg")[0].className.baseVal; let ot = 0; let om = 0; let ir = 1000; let mr = 1000; //console.log(svgicon) if(svgicon == "svg-icon list_attach_img"){ //console.log("adding img") //d[idx].prepend(d[idx].childNodes[idxx]); ot+=1; } if(svgicon == "svg-icon list_attach_video"){ //d[idx].prepend(d[idx].childNodes[idxx]); om+=1; } if(GM_getValue('tgdskin') == true && om>0){ //d[idx].childNodes[0].getElementsByTagName("svg")[0].remove(); let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/video.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].childNodes[0].prepend(z); } else if(GM_getValue('tgdskin') == true && ot>0){ //d[idx].childNodes[0].getElementsByTagName("svg")[0].remove(); let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/image_green.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px; padding-right: 2px"; d[idx].childNodes[0].prepend(z); } else if(GM_getValue('tgdskin') == true){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px; padding-right: 2px"; d[idx].childNodes[0].prepend(z); } } }catch{ if(GM_getValue('tgdskin') == true){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px; padding-right: 2px"; d[idx].childNodes[0].prepend(z); } continue; } } },waitinki) },50) }) } }catch{} },200); }catch{} } $(document.getElementById('cafe_main')).on('load', function(){ setTimeout(async function() { enableCommandMenu(); addstyle('.skin-1080 .article-board tbody td {border-bottom: 1px solid #e2e2e2;}'); addstyle('.article-board tbody td {border-bottom: 1px solid #e2e2e2;}'); addstyle('.CommentBox .comment_list .CommentItem { border-top: 1px solid #ccc}'); addstyle('.RelatedArticles .list_item {border-bottom: 1px solid #e2e2e2;}'); addstyle('.CommentBox .comment_list .CommentItem.CommentItem--mine:before {background: #ffffff00}'); addstyle('.CommentBox .comment_list .comment_footer { flex-direction: row; align-items: stretch; font-weight: 500; color:#000;}'); addstyle('.CommentBox .comment_list .comment_footer .comment_info_box {font-weight: 500; color:#000;}'); addstyle('.CommentBox .comment_list .comment_footer .u_likeit_list_module .u_likeit_list_btn .u_cnt {color:#000}'); addstyle('.skin-1080 .article-board .board-list div.inner_list a:visited, .skin-1080 .article-board .board-list div.inner_list div.inner_list a:visited * div.inner_list a:visited, div.inner_list a:visited * {color: #aaa !important;}') GM_addStyle('body {font-weight: 500;}'); addstyle('body {font-weight: 500;}'); if(GM_getValue('fontsize', 14.5)!=0){ addstyle('.skin-1080 .article-board .board-name .inner_name .link_name {font-size: ' + (GM_getValue('fontsize', 14.5)-1) + 'px}'); addstyle('.skin-1080 .article-board .article {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.article-board .article {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.ArticleBoardWriterInfo .nickname {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstylecon('.skin-1080 #cafe-menu .cafe-menu-list li a {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.article_profile .td_date,.article_profile .td_view {border-left: 1px solid rgb(226, 226, 226); font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.article_profile .article {font-weight: 500; font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.article_profile .board-list .cmt {font-weight: bold; font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.skin-1080 .article-board .pers_nick_area .p-nick {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.skin-1080 .article-board .pers_nick_area .p-nick a {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.article-board .pers_nick_area .p-nick {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.article-board .pers_nick_area .p-nick a {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.RelatedArticles .tit_area {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.skin-1080 .article-board .board-box .td_article .article .inner {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.skin-1080 .article-album-sub dt a, .skin-1080 .article-album-sub .reply {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.skin-1080 .article-board .board-list .cmt {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); addstyle('.article-board .board-list .cmt {font-size:' + GM_getValue('fontsize', 14.5) + 'px}'); //addstyle('.skin-1080 .article-board tbody td {padding: 5px 7px}'); addstyle('.skin-1080 .article-memo .memo_lst_section .memo-box {font-size:' + (GM_getValue('fontsize', 14.5)+2) + 'px}'); addstyle('#content-area .cmlist .comm {font-size:' + (GM_getValue('fontsize', 14.5)+2) + 'px}'); } if(GM_getValue('memlevel') == false){ //addstyle('.skin-1080 .article-board .pers_nick_area .mem-level img {display: none}'); addstyle('.WriterInfo .profile_info .nick_level {display:none;}'); addstyle('.ArticleBoardWriterInfo .LevelIcon {display: none}'); addstyle('.CommentBox .comment_list .comment_nick_box .LevelIcon {display:none;}'); } if(GM_getValue('tgdskin', true)){ addstyle('.BaseButton--green { background: #6441a5; color: #fff;}'); addstyle('.skin-1080 .article-board .pers_nick_area .mem-level img {vertical-align: middle;}'); addstyle('.article-board .pers_nick_area .mem-level img {vertical-align: middle}'); addstyle('.input_search_area .btn-search-green {background-color: #6441a5;}'); addstyle('.input_search_area .btn-search-green {background-color: #6441a5;}'); addstylecon('.skin-1080 .cafe-write-btn a {background-color: #6441a5;}'); addstylebody('.cafe-search .btn {background-color: #6441a5;}'); addstyle('.skin-1080 .article-board .th_name {text-align: center;}'); addstyle('.CafeViewer .se-viewer .BaseButton--green { background: #6441a5; color: #fff;}'); addstyle('.skin-1080 .article-board .td_article {padding-left: 0px; padding-right: 2px;}'); addstyle(".skin-1080 .article-board .td_view {border-left: 1px solid rgb(226, 226, 226);}"); addstyle('.skin-1080 .article-board .board-tag {padding-left: 8px; padding-right: 15px;}'); addstyle('.skin-1080 .article-board .board-name {padding: 0 10px 0 0;}'); addstyle('.skin-1080 .article-board .board-name .inner_name {border-right: 1px solid rgb(226, 226, 226); text-align: center;}'); addstyle('.skin-1080 .article-board .board-notice .board-tag-txt {width: 48px;}'); addstyle('.skin-1080 .article-board .board-name .inner_name .link_name {text-align: center;}'); addstyle('.skin-1080 .article-board .board-number .inner_number {border-right: 1px solid rgb(226, 226, 226); text-align: center;}'); addstyle('.skin-1080 .article-board .td_likes {border-left: 1px solid rgb(226, 226, 226);}'); addstyle('.skin-1080 .article-board .board-list .cmt {color: #6441a5 !important;}'); addstyle('.skin-1080 .article-board .board-list .answer {color: #6441a5;}'); addstyle('.skin-1080 .article-board .board-list .ico-q {color: #6441a5;}'); addstyle('.skin-1080 .article-board .board-list .p_cafebook {color: #6441a5;}'); addstyle('.skin-1080 .article-board .board-list .reply_del {color: #6441a5;}'); addstyle('.skin-1080 .article-board .board-list .reply_txt {color: #6441a5;}'); addstyle('.skin-1080 .article-board .board-list .reply_txt:after {border-color: #6441a5 transparent transparent transparent;}'); addstyle('.skin-1080 .article-board .board-list .reply_txt.is_selected:after {border-color: transparent transparent #6441a5 transparent;}'); addstyle('.skin-1080 .article-board .pers_nick_area .p-nick {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid rgb(226, 226, 226); border-right: 1px solid rgb(226, 226, 226); text-align: center;}'); addstyle('.skin-1080 .article-board .pers_nick_area .p-nick a {text-align: center;}'); addstyle('.skin-1080 .article_list_message .message {color: #616161;}'); addstyle('.skin-1080 .article-album-sub .reply {color: #6441a5;}'); addstyle('.skin-1080 .article-album-sub .price {color: #6441a5;}'); addstyle('.skin-1080 .article-album-movie-sub .tit_area .reply {color: #6441a5;}'); addstyle('.skin-1080 .article-movie-sub .tit_area .reply {color: #6441a5;}'); addstyle('.skin-1080 .article-tag .list_tag .tit_area .cmt {color: #6441a5;}'); addstyle('.skin-1080 .article-intro .box_history .fileview .txt_file {color: #6441a5;}'); addstyle('.skin-1080 .board-notice.type_required .article, .skin-1080 .board-notice.type_main .article {color: #6441a5;}'); addstyle('.skin-1080 .board-notice.type_required .cmt, .skin-1080 .board-notice.type_main .cmt { color: #6441a5;}'); addstyle('.skin-1080 .board-notice.type_required .board-tag-txt, .skin-1080 .board-notice.type_main .board-tag-txt { border: 1px solid #6441a5; background-color: #6441a5; color: #fff;}'); addstyle('.skin-1080 .board-notice.type_menu .article { color: #6441a5;}'); addstyle('.skin-1080 .board-notice.type_menu .cmt { color: #6441a5;}'); addstyle('.skin-1080 .board-notice.type_menu .board-tag-txt { border: 1px solid #6441a5; background-color: #6441a5; color: #fff;}'); addstyle('.skin-1080 .com .box-w .group-mlist .tcol-p { color: #6441a5;}'); addstyle('.skin-1080 .prev-next a.on {background-color: #5f44a1;color: #fff;}'); addstyle('.skin-1080#main-area .bg-color { background-color: #eaea00;}'); addstyle('.skin-1080#main-area .m-tcol-c { color: #000;}'); addstyle('.skin-1080#main-area .m-tcol-p { color: #6441a5;}'); addstyle('.skin-1080#main-area .article-album-sub { border-bottom: 1px solid #ff0000;}'); addstyle('.skin-1080 .article-board thead th {border-bottom-color: #e2e2e2;}'); addstyle('.skin-1080 .article-board tbody td {border-color: #e2e2e2; !important}'); addstyle('.skin-1080 .ia-info-btn .link_chat {display: none;}'); addstyle('.ModalLayer .layer_commerce_content .cate_box .category_list li.selected .btn { color: #5f44a1}'); addstyle('.ModalLayer .layer_schedule_content .register .btn_add_map.active { color: #5f44a1}'); addstyle('.BaseButton .svg-icon.icon-solid-writing { color: #fff;}'); addstyle('.BaseButton--skinGreen { background: #6441a5; color: #ffffff;}'); addstyle('.BaseButton--greenMain { background: #5f44a1;}'); addstyle('.ArticleTitle .link_board { color: #5f44a1}'); addstyle('.WriterInfo .profile_info .subscript_area .btn_subscript {color: #ffffff;}'); addstyle('.LoadingSquare .dot{background: #5f44a1;}'); addstyle('.ReplyBox .like_article {font-size: 14px; display: inline-block; padding: 6px 12px; margin-bottom: 0px; font-size: 14px; font-weight: 400; line-height: 1.42857; text-align: center; white-space: nowrap; vertical-align: middle; touch-action: manipulation; cursor: pointer; user-select: none; background-image: none; border: 1px solid rgba(0, 0, 0, 0); border-radius: 4px; color: rgb(92, 184, 92); background-image: none; background-color: rgba(0, 0, 0, 0); border-color: rgb(92, 184, 92);}'); addstyle('.ReplyBox .like_article .u_likeit_list_module { margin-right: 0px}'); addstyle('.ReplyBox .like_article .u_likeit_list_module .u_likeit_list_btn .u_ico { width: 20px; height: 20px; background: url(https://raw.githubusercontent.com/ywj515/tgdcafe/main/like.svg); no-repeat;}'); addstyle('.ReplyBox .like_article .u_likeit_list_module .u_likeit_list_btn.on .u_ico { background: url(https://raw.githubusercontent.com/ywj515/tgdcafe/main/like.svg); no-repeat}'); addstyle('.SubscribeButton .ToggleSwitch .switch_input:checked+.switch_slider { background-color: #5f44a1}'); addstyle('.CommentBox .comment_list .comment_nick_box .comment_nick_info .comment_info_date { right: 0 !important;}'); addstyle('.ReplyBox .box_left .like_article .ReactionLikeIt.u_likeit_list_module._cafeReactionModule .like_no.u_likeit_list_btn._button.off .u_ico._icon {width: 20px; height: 20px;margin-right: 6px;background: url(https://raw.githubusercontent.com/ywj515/tgdcafe/main/like_not.svg); no-repeat};'); addstyle('.ReplyBox {display: flex; justify-content:center; margin-top:20px}'); addstyle('.ReplyBox .box_left .like_article .ReactionLikeIt.u_likeit_list_module._cafeReactionModule .like_no.u_likeit_list_btn._button.on .u_ico._icon {width: 20px; height: 20px;margin-right: 6px;background: url(https://raw.githubusercontent.com/ywj515/tgdcafe/main/like.svg); no-repeat}'); addstyle('.ToggleButton .checkbox:checked+.label .bg_track[data-v-d8e678f2] { background-color: #5f44a1}'); addstyle('.vote_check .label_box .vote_rate .rate_bar[data-v-74c2a70c] {background-color: #5f44a1;}'); addstyle('.vote_check .label_box .vote_rate .txt[data-v-74c2a70c] {color: #5f44a1;}'); addstyle('.CafeCustomVote .cafe_vote_view .cafe_vote_list .vote_check .label_box .vote_rate .rate_bar[data-v-4f21a8f4] {background-color: #5f44a1;}'); addstyle('.CafeCustomVote .cafe_vote_view .cafe_vote_list .vote_check .label_box .vote_rate .txt[data-v-4f21a8f4] {color: #5f44a1;}'); addstyle('.CafeViewer .CafeCustomVote .cafe_vote_view .cafe_vote_list .vote_check .label_box .vote_rate .rate_bar {background-color: #5f44a1;}'); addstyle('.CafeViewer .CafeCustomVote .cafe_vote_view .cafe_vote_list .vote_check .label_box .vote_rate .txt {color: #5f44a1;}'); addstyle('.CafeViewer .CafeCustomSchedule .cafe_schedule_view .cafe_schedule_view_title .cafe_schedule_view_important { color: #5f44a1}'); addstyle('.CafeViewer .CafeCustomSchedule .cafe_schedule .cafe_schedule_title .cafe_schedule_important { color: #5f44a1}'); addstyle('.CafeViewer .se-viewer .BaseButton--greenMain { background: #5f44a1;}'); addstyle('.FormSelectBox .select_option .item[aria-selected=true] .option { color: #5f44a1}'); addstyle('.TimePicker .layer_select_time .time_item[aria-selected=true] .selectbox_item_button { color: #5f44a1}'); addstyle('.CalendarSelectBox .vdp-datepicker .vdp-datepicker__calendar .cell:not(.blank):not(.disabled).day:hover,.CalendarSelectBox .vdp-datepicker .vdp-datepicker__calendar .cell:not(.blank):not(.disabled).month:hover,.CalendarSelectBox .vdp-datepicker .vdp-datepicker__calendar .cell:not(.blank):not(.disabled).year:hover {color: #5f44a1}'); addstyle('.LoadingRing .box {border-color: #5f44a1 transparent transparent transparent;}'); addstyle('.SelectRegion .select_city_header .city_button.selected { color: #5f44a1}'); addstyle('.SelectRegion .select_city_content .region_list li.selected .btn { color: #5f44a1}'); addstyle('.comm_layer2.npay_guide_layer .box_area .go {color: #5f44a1!important}'); addstyle('.layernotice .btns .link_confirm { color: #5f44a1}'); addstyle('.ModalLayer .layer_commerce_safety_guide .deal_thead .safety_deal_step {color: #5f44a1}'); addstyle('.PurchaseButton .purchase_chat .chat_coach_mark {background-color: #5f44a1;}'); addstyle('.SaleInfo .ProductName .SaleLabel.reservation_escrow,.SaleInfo .ProductName .SaleLabel.safety { color: #5f44a1}'); addstyle('.RelatedArticles .tit_area b { color: #5f44a1}'); addstyle('.MemberOnlyArticleGuide .tit_guide .emph { color: #5f44a1}'); addstyle('.MemberOnlyArticleGuide .txt_cafe {color: #5f44a1;}'); addstyle('.LayerPopup .temporary_message .lds-ring div {border: 2px solid #5f44a1; border-color: #5f44a1 transparent transparent transparent}'); addstyle('.WriterInfo .profile_info .subscript_area .btn_subscript {background: #5f44a1};'); addstyle('.RelatedArticles .tit_area .num {color: #5f44a1;}'); addstyle('.WriterInfo .profile_info .link_talk {display:none;)'); addstyle('.ReplyBox .button_comment {display:none}'); addstyle('.ArticleContentBox .article_writer {display:none}'); addstyle('.ReplyBox .like_article .button_like_list {display:none}'); addstyle('.article-board .board-list .cmt { color: #5f44a1}'); addstyle('.list-i-new { display: none}'); addstyle('.article-board .th_name {text-align: center;}'); addstyle('.article-board .td_article {padding-left: 0px; padding-right: 2px;}'); addstyle(".article-board .td_view {border-left: 1px solid rgb(226, 226, 226);}"); addstyle('.article-board .board-tag {padding-left: 8px; padding-right: 15px;}'); addstyle('.article-board .board-name {padding: 0 10px 0 0;}'); addstyle('.article-board .board-name .inner_name {border-right: 1px solid rgb(226, 226, 226); text-align: center;}'); addstyle('.article-board .board-notice .board-tag-txt {width: 48px;}'); addstyle('.article-board .board-name .inner_name .link_name {text-align: center;}'); addstyle('.article-board .board-number .inner_number {border-right: 1px solid rgb(226, 226, 226); text-align: center;}'); addstyle('.article-board .td_likes {border-left: 1px solid rgb(226, 226, 226);}'); addstyle('.article-board .board-list .cmt {color: #6441a5 !important;}'); addstyle('.article-board .board-list .answer {color: #6441a5;}'); addstyle('.article-board .board-list .ico-q {color: #6441a5;}'); addstyle('.article-board .board-list .p_cafebook {color: #6441a5;}'); addstyle('.article-board .board-list .reply_del {color: #6441a5;}'); addstyle('.article-board .board-list .reply_txt {color: #6441a5;}'); addstyle('.article-board .board-list .reply_txt:after {border-color: #6441a5 transparent transparent transparent;}'); addstyle('.article-board .board-list .reply_txt.is_selected:after {border-color: transparent transparent #6441a5 transparent;}'); addstyle('.article-board .pers_nick_area .p-nick {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid rgb(226, 226, 226); border-right: 1px solid rgb(226, 226, 226); text-align: center;}'); addstyle('.article-board .pers_nick_area .p-nick a {text-align: center;}'); addstyle('.article_list_message .message {color: #616161;}'); addstyle('.article-album-sub .reply {color: #6441a5;}'); addstyle('.article-album-sub .price {color: #6441a5;}'); addstyle('.article-album-movie-sub .tit_area .reply {color: #6441a5;}'); addstyle('.article-movie-sub .tit_area .reply {color: #6441a5;}'); addstyle('.article-tag .list_tag .tit_area .cmt {color: #6441a5;}'); addstyle('.article-intro .box_history .fileview .txt_file {color: #6441a5;}'); addstyle('.board-notice.type_required .article, .board-notice.type_main .article {color: #6441a5;}'); addstyle('.board-notice.type_required .cmt, .board-notice.type_main .cmt { color: #6441a5;}'); addstyle('.board-notice.type_required .board-tag-txt, .board-notice.type_main .board-tag-txt { border: 1px solid #6441a5; background-color: #6441a5; color: #fff;}'); addstyle('.board-notice.type_menu .article { color: #6441a5;}'); addstyle('.board-notice.type_menu .cmt { color: #6441a5;}'); addstyle('.board-notice.type_menu .board-tag-txt { border: 1px solid #6441a5; background-color: #6441a5; color: #fff;}'); addstyle('.com .box-w .group-mlist .tcol-p { color: #6441a5;}'); addstyle('.prev-next a.on {background-color: #5f44a1;color: #fff;}'); addstyle('.article-board thead th {border-bottom-color: #e2e2e2;}'); addstyle('.article-board tbody td {border-color: #e2e2e2; !important}'); addstyle('.ArticleBoardWriterInfo {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid rgb(226, 226, 226); border-right: 1px solid rgb(226, 226, 226); text-align: center;}'); addstyle('.RelatedArticles .tit_area .new-12-x-12 {display: none}'); addstyle('.RelatedArticles .tit_area .svg-icon.list_attach_img {display: none}'); addstyle('.RelatedArticles .tit_area .svg-icon.list_attach_video {display: none}'); addstyle('.RelatedArticles .member_area {padding-left: 0; text-align: center; border-left: 1px solid rgb(226, 226, 226); border-right: 1px solid rgb(226, 226, 226);}'); addstyle('.RelatedArticles .date_area {padding-right: 16px;}'); addstyle('.RelatedArticles .list_item:first-child {border-top: 1px solid #e2e2e2;}'); addstyle('.TabButton .tab_btn[aria-selected=true] {background-color: #6441a5; color: #fff;}'); addstyle('.article_profile .article {font-weight: 500;}'); addstyle('.article_profile .td_article {padding: 3px 2px 2px 4px;}'); addstyle('.article_profile .td_date,.article_profile .td_view {border-left: 1px solid rgb(226, 226, 226);}'); addstyle('.article-board .board-list .inner_list .svg-icon.list_attach_img {display:none}'); addstyle('.article-board .board-list .inner_list .svg-icon.list_attach_video {display:none}'); addstyle('.skin-1080 .list-i-img {display:none}'); addstyle('.skin-1080 .list-i-movie {display:none}'); addstyle('.skin-1080#main-area .board-box img.tcol-c {background-color: rgba(0, 0, 0, 0)}'); addstylecon('.skin-1080 .ia-info-btn .link_chat {display:none}'); addstylecon('.skin-1080 .ia-info-btn .link_chat .new_chatting {display:none}'); addstyle('.article_profile .list-style .link_sort.on {color: #6441a5}'); addstyle('.article_profile .list-style .link_sort.on:after {background-color: #6441a5}'); addstyle('.article_profile .board-list .cmt {font-weight: bold;}'); addstyle('.skin-1080 .article-board .board-list .search_word { color: #6441a5;}'); } try{ await imageenlarger(); }catch{}; }, 1);}); async function imageenlarger() { if(GM_getValue('tgdskin', true)) await styleadding(); console.log(GM_getValue('star')); console.log(GM_getValue('tgdskin')); if(GM_getValue('star') == true || GM_getValue('tgdskin') == true ){ console.log("OK"); await addiconstar(); await inkilist(); } await console.log("wait for imageenlarger"); var loadd = await getcommentlist(); await console.log(loadd); await console.log("start imageenlarger"); await setTimeout(async function() { z = document.createElement('style'); z.innerHTML ='.CommentBox .comment_list .CommentItemImage .comment_image_link .image { max-width: 100%; max-height: 100%; vertical-align: top; border-radius: 0%}'; document.querySelector('#cafe_main').contentWindow.document.body.appendChild(z); let a = await document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); await console.log("초기 댓글 늘리는 중..."); var waittime = 200 if(stop==0){ if(a.length==0){ waittime+=500; } a.forEach((element) => { if (element.firstChild.src == "" || element.firstChild.src.startsWith("https://cafe.naver.com")){ console.log("wait"); waittime = waittime + 50; a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); } }); console.log(waittime); setTimeout(await function(){ a = document.querySelector('#cafe_main').contentWindow.document.querySelectorAll('.comment_image_link'); a.forEach((element) => { if(element.firstChild.currentSrc.includes("_gif")==true){element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375_gif","");} if(element.firstChild.src.includes("_gif")==true){element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375_gif","");} element.firstChild.currentSrc = element.firstChild.currentSrc.replaceAll("?type=mc250_375",""); element.firstChild.src = element.firstChild.src.replaceAll("?type=mc250_375",""); //console.log(element.firstChild.outerHTML); }); console.log(a); console.log("enlarge picture"); },waittime); } var idxintvf = 0; var intvf = await setInterval(async function() { try{ comnum = await document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName('button_comment')[0].getElementsByClassName('num')[0].innerHTML; }catch{ idxintvf+=1; if(idxintvf>100) await clearInterval(intvf); return false;} //when element is found, clear the interval. console.log("comnum found"); console.log(comnum); //await sleep(500); await clearInterval(intvf); await console.log(comnum); //await console.log("eeeeeeeeeeeeeeeeeeeeeeeee"); await addbutton(); await console.log("버튼추가"); await console.log("adding observer.."); await addObserverIfDesiredNodeAvailable(); }, 100); }, 100); } async function bestcomment(){ try{ let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("CommentItem"); let newnu = d.length; var bestwait = 200; for(let idx=0; idx<newnu; idx++){ if(d[idx].getElementsByClassName("u_cnt _count")[0].innerText == ""){ bestwait += 30; } } console.log(d); var bestcoms = []; var comlikenums = []; setTimeout(function(){ for(let idx=0; idx<newnu; idx++){ console.log(d[idx].getElementsByClassName("u_cnt _count")[0].innerText); if(Number(d[idx].getElementsByClassName("u_cnt _count")[0].innerText)>=5) { console.log("인기!"); var inkicom = d[idx].cloneNode(true); inkicom.style="background: #fff4ea !important;"; let f = document.createElement("span"); f.style="background-color: rgb(217, 83, 79); display: inline; padding: 0.2em 0.6em 0.3em; font-size: 75%; font-weight: 700; line-height: 1; color: rgb(255, 255, 255); text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 0.25em;"; f.innerText = "BEST"; inkicom.getElementsByClassName("comment_nick_info")[0].prepend(f); inkicom.getElementsByClassName("comment_info_button")[0].remove(); bestcoms.push(inkicom); comlikenums.push(Number(d[idx].getElementsByClassName("u_cnt _count")[0].innerText)); } } console.log(bestcoms); comlikenums.sort(function(a, b){return b - a;}); console.log(comlikenums); for(let idx=comlikenums.length-1;idx>comlikenums.length-4;idx--){ for(let idxx=0; idxx<bestcoms.length; idxx++){ if(bestcoms[idxx].getElementsByClassName("u_cnt _count")[0].innerText == comlikenums[idx]){ let e = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("comment_list")[0]; e.prepend(bestcoms[idxx]); } } } },bestwait); }catch{} } async function styleadding(){ console.log("start styleadding"); var ggg = 0; var kkk = 0; var gggg = 0; var ggggg = 0; try{ let a = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("list-i-new") newnum = a.length; //console.log(a) gggg = newnum; console.log(gggg); for(let idx=0; idx<newnum; idx++){ a[idx].remove() } let b = document.getElementsByClassName("ico_new") newnum = b.length //console.log(newnum); //console.log(b) for(let idx=0; idx<newnum; idx++){ b[idx].remove() } let c = document.querySelector('#cafe_main').contentWindow.document.getElementsByTagName("img") newnum = c.length //console.log(newnum); //console.log(c) for(let idx=0; idx<newnum; idx++){ //console.log(c[idx]); if (c[idx] != undefined) if (c[idx].src == "https://ssl.pstatic.net/static/cafe/cafe_pc/icon_board_new.png") c[idx].remove(); } try{ let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("p-nick") newnum = d.length //console.log(newnum); //console.log(d) for(let idx=0; idx<newnum; idx++){ //console.log(d[idx].childNodes[1]) if(d[idx].childNodes[1].getElementsByTagName("img")[0].src == "https://cafe.pstatic.net/levelicon/1/6_999.gif"){ d[idx].childNodes[1].getElementsByTagName("img")[0].src="https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/1"; d[idx].childNodes[1].getElementsByTagName("img")[0].height = 15; d[idx].childNodes[1].getElementsByTagName("img")[0].width = 15; d[idx].prepend(d[idx].childNodes[1]); } else{ if(GM_getValue('memlevel')==false){ d[idx].childNodes[1].remove() } } }}catch{}; setTimeout(function(){ let d2 = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("icon_level") newnum = d2.length //console.log(newnum); //console.log(d2) for(let idx=0; idx<newnum; idx++){ //console.log(d2[idx].style.backgroundImage) if(d2[idx].style.backgroundImage == "url(\"https://ca-fe.pstatic.net/web-section/static/img/sprite_levelicon_9dbde2.svg#6_999-usage\")"){ let z = document.createElement('img'); z.src = "https://static-cdn.jtvnw.net/badges/v1/5527c58c-fb7d-422d-b71b-f309dcb85cc1/1"; document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("nick_box")[0].prepend(z); } } },1000); //for(let idx=0; idx<newnum; idx++){ //console.log(d[idx].childNodes[1]) //} try{ setTimeout(function(){ try{ let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("board-box")[0].getElementsByClassName("inner_list"); let e = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("board-box")[0].getElementsByClassName("board-tag type_dot") var dnewnum = d.length //console.log(dnewnum); //console.log(e); var offset = dnewnum - e.length; //console.log(d); for(let idx=0; idx<dnewnum; idx++){ try{ //console.log(d[idx].childNodes); let nnum = d[idx].childNodes.length; let ot = 0; let om = 0; let ir = 10; let mr = 10; for(let idxx=0; idxx<nnum; idxx++){ try{ //console.log(d[idx].childNodes[idxx]); if(d[idx].childNodes[idxx].getElementsByClassName("list-i-img").length!=0){ //d[idx].prepend(d[idx].childNodes[idxx]); //console.log("이미지"); ot+=1; ir = idxx; } else if(d[idx].childNodes[idxx].getElementsByClassName("list-i-movie").length!=0){ //d[idx].prepend(d[idx].childNodes[idxx]); om+=1; mr = idxx; } if(om>0){ e[idx-offset].childNodes[0].src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/video.svg" e[idx-offset].childNodes[0].width="12" e[idx-offset].childNodes[0].height="12"; e[idx-offset].childNodes[0].style="vertical-align: middle;padding-bottom: 2px;"; idxx = nnum; } else if(ot>0){ e[idx-offset].childNodes[0].src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/image_green.svg" e[idx-offset].childNodes[0].width="12" e[idx-offset].childNodes[0].height="12"; e[idx-offset].childNodes[0].style="vertical-align: middle;padding-bottom: 2px;"; idxx = nnum; } }catch{} } if(om==0&&ot==0){ e[idx-offset].childNodes[0].src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" e[idx-offset].childNodes[0].width="12" e[idx-offset].childNodes[0].height="12"; e[idx-offset].childNodes[0].style="vertical-align: middle;padding-bottom: 2px;"; } }catch{} }}catch{} },100)}catch{} await inkilist(); try{ let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("BoardBottomOption")[0].getElementsByClassName("btn number") newnum = d.length //console.log(newnum); console.log(d) for(let idx=0; idx<newnum; idx++){ let nnum = d[idx].childNodes.length; let ot = 0; let om = 0; let ir = 10; let mr = 10; for(let idxx=0; idxx<nnum; idxx++){ if(d[idx].childNodes[idxx].className == "list-i-img"){ //d[idx].prepend(d[idx].childNodes[idxx]); ot+=1; ir = idxx; } if(d[idx].childNodes[idxx].className == "list-i-movie"){ //d[idx].prepend(d[idx].childNodes[idxx]); om+=1; mr = idxx; } } if(mr!=10){ d[idx].removeChild(d[idx].childNodes[mr]); } if(ir!=10){ d[idx].removeChild(d[idx].childNodes[ir]); } if(om>0){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/video.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].prepend(z); } else if(ot>0){ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/image_green.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].prepend(z); } else{ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].prepend(z); } }}catch{} //console.log("1차끝") try{ //console.log("test") setTimeout(function(){ let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("RelatedArticlesList")[0].getElementsByClassName("list_item") newnum = d.length //console.log(newnum); ////console.log(d); ////console.log(newnum); for(let idx=0; idx<newnum; idx++){ try{ d[idx].childNodes[0].getElementsByTagName("img")[0].remove(); }catch{} try{ let svgicon = d[idx].childNodes[0].getElementsByTagName("svg")[0].className.baseVal; let ot = 0; let om = 0; //console.log(svgicon) if(svgicon == "svg-icon list_attach_img"){ //console.log("adding img") //d[idx].prepend(d[idx].childNodes[idxx]); ot+=1; } if(svgicon == "svg-icon list_attach_video"){ //d[idx].prepend(d[idx].childNodes[idxx]); om+=1; } if(om>0){ //d[idx].childNodes[0].getElementsByTagName("svg")[0].remove(); let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/video.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px;"; d[idx].childNodes[0].prepend(z); } else if(ot>0){ //d[idx].childNodes[0].getElementsByTagName("svg")[0].remove(); let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/image_green.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px; padding-right: 2px"; d[idx].childNodes[0].prepend(z); } else{ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px; padding-right: 2px"; d[idx].childNodes[0].prepend(z); } }catch{ let z = document.createElement('img'); z.src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" z.width="12" z.height="12"; z.style="vertical-align: middle;padding-bottom: 2px; padding-right: 2px"; d[idx].childNodes[0].prepend(z); continue; } } },1000); setTimeout(function(){ try{ for(let iii=0; iii<3; iii++){ console.log("글목록 버튼..3"); console.log(document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("paginate_area")[0].getElementsByClassName("ArticlePaginate")[0].getElementsByClassName("btn number")); document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("paginate_area")[0].getElementsByClassName("ArticlePaginate")[0].getElementsByClassName("btn number")[iii].addEventListener("click", async function(){ let d = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName("RelatedArticlesList") setTimeout(function(){ console.log("글목록 다시 불러오기"); console.log("test") d = d[0].getElementsByClassName("list_item") newnum = d.length ////console.log(d); ////console.log(newnum); for(let idx=0; idx<newnum; idx++){ try{ //d[idx].childNodes[0].getElementsByTagName("img")[0].remove(); }catch{} try{ let svgicon = d[idx].childNodes[0].getElementsByTagName("svg")[0].className.baseVal; let ot = 0; let om = 0; //console.log(svgicon) if(svgicon == "svg-icon list_attach_img"){ console.log("adding img") //d[idx].prepend(d[idx].childNodes[idxx]); ot+=1; } if(svgicon == "svg-icon list_attach_video"){ //d[idx].prepend(d[idx].childNodes[idxx]); om+=1; } if(om>0){ d[idx].childNodes[0].getElementsByTagName("img")[0].src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/video.svg" } else if(ot>0){ d[idx].childNodes[0].getElementsByTagName("img")[0].src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/image_green.svg" } else{ d[idx].childNodes[0].getElementsByTagName("img")[0].src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" } }catch{ d[idx].childNodes[0].getElementsByTagName("img")[0].src = "https://raw.githubusercontent.com/ywj515/tgdcafe/main/text.svg" } } },300); }) }}catch{} },2000);}catch{} //console.log("2차시작") }catch{} } function ifDesiredNodeAvailable(classname) { let composeBox = document.querySelector('#cafe_main').contentWindow.document.getElementsByClassName(classname); if(!composeBox[0]) { composeBox = setTimeout(ifDesiredNodeAvailable(classname),1000); return composeBox; } //console.log(composeBox); return composeBox; } function addstyle(config){ let z = document.createElement('style'); z.innerHTML = config; document.querySelector('#cafe_main').contentWindow.document.body.appendChild(z); } function addstylecon(config){ let z = document.createElement('style'); z.innerHTML = config; document.getElementById("content-area").appendChild(z); } function addstylebody(config){ let z = document.createElement('style'); z.innerHTML = config; document.getElementById("cafe-body").appendChild(z); } function addstylerbody(config){ let z = document.createElement('style'); z.innerHTML = config; document.body.appendChild(z); }