kone
소미소프트

소미소프트

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

05/31/2025, 08:06:09
유틸
2361 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
07/30/25
개추콘
RPG-Maker-MV-MZ-Cheat 에서 숫자가 잘 안먹힐 때에 (예시: 언홀리 메이든)
유틸
cybuster
01/15 10187 25
RPG MV/MZ 치트 플러그인 개조 버전 v3.0
유틸
4HHHH
01/13 12800 20
🔞슬레이 더 스파이어 NSFW 아이언클래드 및 기타 카드
유틸
Rasmodia
01/12 33621 34
참고용 ai 프롬프트(이미지) 모음
유틸
urakan915
01/11 12414 18
🔞 슬레이 더 스파이어 NSFW 이벤트 및 휴식 리텍스쳐
유틸
Rasmodia
01/09 14025 37
(청아)your mom 용 vrm 파일 2개
유틸
hamellton1144
01/08 11079 24
동급생2 리메이크 *DL Version* v1.0.2.0 크랙
유틸
핏짜허엇
01/07 10990 30
starmaker(스타메이커) 갤러리 모드
유틸
horseking94
01/04 35703 53
(01.07수정됨)슬레이 더 스파이어 (Slay the Spire) R18 모드 - Echidna (Ai 번역 + 손번역)
유틸
고기사장님
01/04 20472 60
언홀리 메이든 폭탄 증가패치
유틸
yuri88
01/04 14050 18
멀웨어 검사 스크립트 - 편집증 모드 추가 (DLL 전수조사)
유틸
moomin
01/03 8037 23
🔞 슬레이 더 스파이어 NSFW 모드 모음집 + 디펙트 리플레이서
유틸
Rasmodia
01/03 24680 56
⚠️⚠️멀웨어 탐지 스크립트⚠️⚠️ - 260104 수정
유틸
moomin
01/03 33201 128
하급생리메이크 1.0.1패치+크랙
유틸
쿠로
12/28/25 14784 41
모카 러브 ReLive♪ ~진심 순애 거리에서의 절정 표정 관찰 + 귀여운 미소에 폭발 분사 애니메이션~ 노모파일
유틸
미스터장
12/27/25 19419 80
Anaertailin 작가의 Slay the Spire 일부 모드만
유틸
oobd69
12/26/25 16809 15
[후타]pernio의 후타나리 시리즈 노모패치 모음 + 복구 제한 안 두기로 했음
유틸
레가토
12/24/25 9658 20
음혈조복토에하 천박한 한글 데칼 공유
유틸
kkkkcccc
12/23/25 13978 46
언홀리 메이든 스탠딩 일러 노예 마스크 수정해 봄
유틸
5dk2io1
12/23/25 14553 30
[유틸] RJ01497368 라스트 스탠드 기번세트
유틸
Ghost
12/21/25 15524 34
용사 파티 무너뜨리기(Hero Party Must Fall) 0.6 회상방 개선 모드
유틸
이드씬
12/21/25 14267 31
시니시스타2 모드 노모 덮어쓰기 툴
유틸
sims9876
12/20/25 13984 15
통합노모모드 시니시스타2 (SiNiSistar2) 1.2.1 마지막... (25.12.24)
유틸
크로우
12/20/25 44128 131
슬레이 더 스파이어 (Slay The Spire) R18 패치 복구 + 2 모드
유틸
cirial
12/15/25 28263 42
[유틸] RJ01389782 비밀 노출 -배덕의 달콤함에 물든 마나카 커스텀 미션 번역
유틸
kdhehejd
12/14/25 18447 25
압축파일 썸네일 미리보기 프로그램
유틸
fc6974
12/01/25 11744 54
[노모이미지만] 조심의 마도구 ~강하게 아름다운 모험자의 최후~ ver.1.3.0
유틸
미스터장
11/30/25 9543 38
케모노,히토미,X,유튜브 등등 downloader gallery-dl, yt-dlp 활용
유틸
noname
11/25/25 9724 16
줍줍한 유니티6 기계번역세트(기대하지 마십시오.)(재업)
유틸
와랄랄라라
11/24/25 14167 25
texture replacer v1.2.0.4
유틸
kumarin
11/23/25 10811 34