pgh268400 / X_EYE

// ==UserScript==
// @name        X_EYE
// @author       pgh268400
// @match       https://cafe.naver.com/*
// @require     https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @require     https://gist.github.com/raw/2625891/waitForKeyElements.js
// @copyright 2020, pgh268400 (https://openuserjs.org/users/pgh268400)
// @license MIT
// ==/UserScript==


waitForKeyElements (".desc .count", showHiddenID); //페이지 로딩까지 대기

function showHiddenID (jNode) {

    console.log(jNode.text())
    if (jNode.text().includes ('총 방문') ) { // 내가 쓴 글 보기 진입시
         console.log('Detect!')
         var a = document.querySelector(".p-nick .m-tcol-c").getAttribute('onclick')
         var _id = a.split(',')[1].trim().replaceAll("'", "")

        var sel = document.querySelector("div.ellipsis")
        var t = sel.innerHTML // *닉네임(ID) 형식
        var t2 = t.substring(0, t.indexOf('(')+1 ) + _id + ')'
        sel.innerHTML = t2;
    }
}