kone
소미소프트

소미소프트

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

05/31/2025, 08:06:09
유틸
2188 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
로컬LLM(Ollama) 이용한 파이썬 MV 번역 코드
유틸
샤쿠
04/04 21857 21
[RJ01389782] [AI 번역] 비밀 노출 마나카 커스텀 미션 번역 [SekiMissions 8.5]
유틸
bunta_expert
04/04 11401 21
자동소미 해적판
유틸
buttercookie
04/03 7765 21
kio transfer 비번 자동입력
유틸
20250508
04/03 5170 22
Kone base64 auto-decoder
유틸
wef4r2
04/03 3633 6
코이카츠 버튜버 캐릭터 공유(v2)
유틸
pst0025
04/02 11993 53
눈동자 다운로더 GUI (아마도 최신버전)
유틸
하이바라
04/02 6118 16
[미번] 로제리움 ver.1.04 [RJ01515630] 회상방 버그 패치파일
유틸
awsdw
04/02 6450 12
코이카츠 야스씬 공유 - (홍차)
유틸
pst0025
04/01 13519 37
코이카츠 벽람 프리셋 공유(v2)
유틸
pst0025
04/01 15300 46
코이카츠 (?) 프리셋 공유
유틸
pst0025
04/01 16020 33
[Hoi Hoi Hoi]NTR은 모험에서 흔한 일이다 모바일 패치
유틸
qqwqq6666
03/31 5570 8
디코드 클릭하기 귀찮아서 만든 확장프로그램
유틸
20250508
03/31 10881 57
FontForge-2025-10-09-Windows-x64.exe + FontForgeBuilds 한글화.7z
유틸
ㅇㅇ
03/30 9501 6
RPGM VXA 스크립트) ▼ 素材(Materials) ## ゲーム画面倍率切替 - 멀티 모니터 대응 개선판.rb
유틸
ㅇㅇ
03/30 4839 2
celsector 탄약 치트 및 무기, 옷 해금 세이브
유틸
arcabuz
03/30 3522 11
Base 64 Encode Decode 확장 프로그램 업데이트 및 유저스크립트 방식 지원
유틸
shinyiro18
03/29 5349 12
PixivNavi - 픽시브 한손 탐색 스크립트
유틸
oroshinashi9
03/29 4481 7
(빅파이 개조만) 평범한 현실 남매 IN 섹스하지 않으면 나올 수 없는 방.[RJ01332822]
유틸
123551
03/29 8349 15
Base 64 Encode Decode 확장 프로그램 만들어 봤습니다.
유틸
shinyiro18
03/28 6555 18
코하루인가 이거 AI 이미지 번역기 괜찮은 것 같아서 링크 가져와봄
유틸
밀로아
03/28 4966 14
아오이짱 BepInEx 번역플러그인 잘리던거 해결봤다...
유틸
lalalala000
03/28 24227 59
(코이카츠) 시니시스타2 캐릭터 공유 - [리리아]
유틸
pst0025
03/27 19865 40
Deliriumベア@NTR 씬 공유 글에서 빠진 모드 추가
유틸
pst0025
03/27 4469 11
(코이카츠) 원신 캐릭터 공유
유틸
pst0025
03/27 10241 33
(코이카츠) 붕스 캐릭터 공유
유틸
pst0025
03/27 9980 38
데이터 클리너) czkawka - 크로키에트, windows_krokiet_on_windows_skia_opengl.exe
유틸
ㅇㅇ
03/27 10811 21
파이어 엠블렘 인게이지 - 모드 통합(+ 노모) 모드 만 있음
유틸
cumtree
03/27 3817 8
(RGVsaXJpdW3jg5njgqJATlRS) 코이카츠 씬 공유, 캐릭 포함
유틸
pst0025
03/26 9337 16
[후타]pernio의 후타나리 시리즈 노모패치 모음
유틸
레가토
03/26 5711 9