kone
소미소프트

소미소프트

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

05/31/2025, 08:06:09
유틸
2191 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
[복구] 란스03 노모패치
유틸
imakotou
04/28 15921 28
REC 리듬게임 추가 MOD
유틸
kunarin
04/28 7569 12
MZ MV data 복호화 실행기
유틸
미요포
04/27 13662 38
90일, RJ01540816 한정 복호화 도구) RMMZ JSON 통합 복호화 도구.pyw + RJ01540816 복호화.7z
유틸
ㅇㅇ
04/27 6543 6
제품 코드 추출기, 제품 코드 중복 찾기
유틸
ㅇㅇ
04/27 8446 18
MMD 모션,음악 통팩 공유
유틸
pst0025
04/26 9066 56
(코이카츠) 솔O티엘 작가 프리셋 통팩 공유
유틸
pst0025
04/25 12141 73
(코이카츠) 에러난 파일 복구 및 빠진거 보완
유틸
pst0025
04/25 10698 31
RPG MV/MZ 치트 플러그인 웹 딸깍 설치 오픈
유틸
mrpls
04/25 11373 28
자동소미 해적판의 해적판 업데이트
유틸
스눕제이크
04/23 8181 12
RPG MV/MZ 안실시간 미리번역 업데이트
유틸
mrpls
04/23 7823 27
파일 구글 번역기) kr_tr_7.pyw
유틸
ㅇㅇ
04/22 12258 9
(코이카츠) - "큰거"
유틸
pst0025
04/22 16059 66
(코이카츠) 큰거 올리기 전에 작은거
유틸
pst0025
04/22 18935 62
(코이카츠) - 최신 프리셋 일부 공유 [v2]
유틸
pst0025
04/22 10918 45
마나카 모드들
유틸
kkkktrrr
04/22 17159 33
(코이카츠) - 최신 프리셋 일부 공유
유틸
pst0025
04/21 10758 48
유틸) RJ코드 이미지 검색 용 기능추가
유틸
ATTAA
04/20 11985 9
VXA 스크립트) ▼ 素材(Materials) ## 한영이름 입력 스크립트.rb
유틸
ㅇㅇ
04/20 8693 7
RPG MV/MZ 실시간 번역기 딸깍 설치 웹사이트 오픈 (2.3 번역 주위 짤림)
유틸
mrpls
04/19 33300 106
(코이카츠) - グラフ 통팩 공유
유틸
pst0025
04/19 23160 56
유틸)유저스크립트-썸네일&본문 이미지 허용/비허용
유틸
cloud67p
04/19 7754 4
RPG MV/MZ 실시간 번역기 1.10 (루나와 음욕의 함정 던전, 젬마4)
유틸
mrpls
04/18 24736 35
VX or VXA 풀스크린 스크립트) ## VX Fullscreen++ Multi-Monitor.rb + ## VXA Fullscreen++ Multi-Monitor v2.32.rb
유틸
ㅇㅇ
04/18 8942 5
[노모패치, AI] 한 번만이라도 좋으니까, 나랑 해줘!
유틸
soxocel777
04/17 15245 29
자동 소미 해적판의 해적판
유틸
스눕제이크
04/17 9521 9
[복구]SecretFlasher.VoicePack-Plus 마나카 음성모드 개인수정(로우튠 등)
유틸
leedi
04/16 13244 7
( 코이카츠 ) - Anna anon 씬카드 공유
유틸
pst0025
04/16 24308 63
자동소미 해적판 업데이트
유틸
buttercookie
04/16 9440 12
[요청복구]스타바운드 통팩 모드만[구버전, 2024.06.17)
유틸
liberty
04/15 9694 1