kone
소미소프트

소미소프트

댓글 자동확장 개선 스크립트

05/31/2025, 08:06:09
유틸
2176 views · 6 likes

https://kone.gg/s/somisoft/b3Kid-M_YjOKD_kofh5zyb

여기 이분 스크립트에서 챗지피티로 댓글 확장 코드만 추출 후 개선한 스크립트입니다. 문제시 글삭함

원본 작성자가 삭제 요청시 글내림(허락받음ㅎ). 오류 생기면 스크립트 삭제 추천


1

원본 댓글 확장은 대댓 확장만 자동이고 댓글 더 불러오기는 자동이 아니라서 추가했습니다.


1
1

템퍼몽키 확장프로그램 받으시고 새 스크립트 만들기 > 안에 내용 지우고 스크립트 복붙 > 파일 저장


아래는 스크립트입니다.

// ==UserScript==
// @name         kone 댓글 자동 확장 + 더 불러오기
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  kone.gg에서 댓글을 자동으로 확장하고 '댓글 더 불러오기'도 자동 클릭합니다.
// @author       김머시기
// @match        https://kone.gg/*
// @grant        none
// @license      MIT
// @run-at       document-idle
// ==/UserScript==

(function () {
    'use strict';

    function clickAllExpandButtons() {
        const expandButtons = document.querySelectorAll('button');
        let clickedAny = false;

        expandButtons.forEach(button => {
            try {
                const text = button.textContent.trim();
                const isCommentExpand = /^\d+개의 댓글$/.test(text);
                const isLoadMore = text === '댓글 더 불러오기';

                if ((isCommentExpand || isLoadMore) && button.offsetParent !== null) {
                    button.click();
                    clickedAny = true;
                }
            } catch (e) {
                // 무시
            }
        });

        if (clickedAny) {
            // 여전히 확장할 수 있는 버튼이 남아있을 수 있으므로 재귀 호출
            setTimeout(clickAllExpandButtons, 500);
        }
    }

    function updateGlobalStyles() {
        const styleFix = document.createElement('style');
        styleFix.textContent = `
            .comment-wrapper,
            .comment-wrapper .overflow-x-auto,
            .comment-wrapper .overflow-hidden,
            .thread-body-content .overflow-hidden {
                overflow: visible !important;
                max-height: none !important;
            }
        `;
        document.head.appendChild(styleFix);
    }

    function runCommentFix() {
        clickAllExpandButtons();
        updateGlobalStyles();
    }

    const observer = new MutationObserver(() => {
        clearTimeout(commentFixTimer);
        commentFixTimer = setTimeout(runCommentFix, 100);
    });

    let commentFixTimer = null;

    observer.observe(document.body, { childList: true, subtree: true });
    observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] });

    function observeURLChange() {
        let lastUrl = location.href;

        const urlChangeHandler = () => {
            if (location.href !== lastUrl && location.href.includes('/s/')) {
                lastUrl = location.href;
                setTimeout(runCommentFix, 500);
            }
        };

        const urlObserver = new MutationObserver(urlChangeHandler);
        urlObserver.observe(document.body, { childList: true, subtree: true });

        const originalPush = history.pushState;
        history.pushState = function () {
            originalPush.apply(this, arguments);
            urlChangeHandler();
        };

        window.addEventListener('popstate', urlChangeHandler);
    }

    const init = () => {
        runCommentFix();
        observeURLChange();
    };

    if (document.readyState === 'complete' || document.readyState === 'interactive') {
        init();
    } else {
        document.addEventListener('DOMContentLoaded', init);
    }
})();
6
1 comment
Sign in to comment
07/30/25
개추콘
Sign in to comment
[유틸] [노모] 비밀 노출 -배덕의 달콤함에 물든 마나카- 노모패치 v1.0.0.6
유틸
Ghost
06/15/25 14097 15
업뎃) 스텔라블레이드 릴리 누드모드
유틸
konekat
06/14/25 18502 65
[업뎃알림] 오토소미
유틸
김머시기
06/12/25 10964 34
야식메뉴판 업뎃해옴 - 2.0.0
유틸
qqoro
06/12/25 13804 70
RPGMVP 파일을 포토샵으로 열고 수정하고 저장하장!!!!!!!!!!!!!!!!
유틸
moomin
06/12/25 4836 17
코네 유저 메모 및 차단 스크립트
유틸
글쓴이
06/11/25 6401 17
[노모패치] 졸린 유대감 ver.1.2.1
유틸
77777
06/10/25 10062 29
[RJ01367733] 요정의 물약 공장 기번 유틸
유틸
takodachi
06/09/25 2879 6
시니시스타 2 모드 모음
유틸
sims9876
06/09/25 12345 33
[2025-06-20] 게시글 url 추출
유틸
kts
06/09/25 2622 3
시니시스타2 알몸폭유모드
유틸
ㅇㅇ
06/08/25 13418 37
히토미 다운로더용 kone 이미지 일괄 다운로드 스크립트
유틸
글쓴이
06/08/25 7483 31
메스가키 새여동생♡낮져밤져 유혹섹활 AI노모
유틸
물크스
06/08/25 9918 77
.RPGMVP .PNG_을 반디뷰에서도 열어보장
유틸
moomin
06/07/25 4790 11
동인탭 글 숨기는 스크립트(수정v2)
유틸
딸기맛농축함유🍓
06/07/25 3112 2
야겜 모드 모음
유틸
나나바
06/06/25 9742 4
(긴급!)유니티 제미니 AI 자동번역 딜레이 대폭수정및 검열회피(반드시 새로 받아야함)
유틸
알탕
06/05/25 15303 33
코네 wide 모드
유틸
arcjay
06/05/25 3665 10
유니티 (AutoTranslator) 제미니 AI번역기 무료 API 다중추가 삽입및 번역 재시도 기능 추가
유틸
알탕
06/04/25 9120 23
[업뎃] Auto Somi 자동 국룰입력/복호화/다운로드/미리보기 등
유틸
김머시기
06/04/25 14926 53
(수정) 유니티 자동번역기(autotranslator) 제미니 ai (Gemini) 번역하기 풀세트
유틸
알탕
06/02/25 38448 87
[코네 스크립트] 단축키 변경 및 추가 / 다운로드 버튼 추가 / 사이트 색상 변경(이상함) [250603]
유틸
유령
06/02/25 3328 13
txt - csv 변환기
유틸
팰애호단체
06/02/25 2531 5
썸네일 크기조절 스크립트
유틸
딸기맛농축함유🍓
06/01/25 2851 4
던전 앤 브라이드 파밍 치트 공유 (20250601 17:16 수정)
유틸
rengester
06/01/25 6294 7
몬스터 블랙마켓 (몬블마) 브리딩 모드 한글 번역판(25.06.09 수정)
유틸
이노
05/31/25 11522 7
직접 만든 던전 앤 브라이드 모드 패치 공유
유틸
rengester
05/31/25 4960 10
유저스크립트 공유(업데이트250531)
유틸
cloud67p
05/31/25 3869 2
댓글 자동확장 개선 스크립트
유틸
딸기맛농축함유🍓
05/31/25 2176 6
댓글 최신순/등록순 버튼 분리(댓글 새로고침) 스크립트
유틸
딸기맛농축함유🍓
05/31/25 1648 2