치지직 팔로우 목록 자동 새로고침 + 자동 펼치기

팔로우 목록을 원하는 시간마다 반복 새로고침 + 팔로우 목록을 자동으로 전부 펼칩니다.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name         치지직 팔로우 목록 자동 새로고침 + 자동 펼치기
// @namespace    http://tampermonkey.net/
// @version      1.1.1
// @description  팔로우 목록을 원하는 시간마다 반복 새로고침 + 팔로우 목록을 자동으로 전부 펼칩니다.
// @match        *://chzzk.naver.com/*
// @grant        none
// @author       Lusyeon | 루션
// @license MIT
// ==/UserScript==

(function () {
    'use strict';

    const refreshInterval = 60000; // 1분마다 새로고침 1초당 1000

    setInterval(() => {
        const refreshBtn = Array.from(document.querySelectorAll('button.navigator_button__BbAEb'))
            .find(btn => btn.textContent.includes("새로고침"));
        if (refreshBtn) {
            refreshBtn.click();
        }
    }, refreshInterval);

    window.addEventListener('load', () => {
        const clickAllMoreButtons = () => {
            const moreBtn = document.querySelector('button.navigator_button_more__UE0v3[aria-expanded="false"]');
            if (moreBtn) {
                moreBtn.click();
                return true;
            }
            return false;
        };

        const observer = new MutationObserver(() => {
            const isClicked = clickAllMoreButtons();
            if (!isClicked) {
                setInterval(() => {
                    clickAllMoreButtons();
                }, refreshInterval);
            }
        });

        observer.observe(document.body, { childList: true, subtree: true });

        setTimeout(() => {
            clickAllMoreButtons();
        }, 10000);
    });

})();