Greasy Fork

Greasy Fork is available in English.

Auto somi

자동 복호화/국룰입력/다운(Kiosk, Mega, GoogleDrive, goFile)

当前为 2025-05-17 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Auto somi
// @name:ko      자동 소미
// @namespace    http://tampermonkey.net/
// @description  자동 복호화/국룰입력/다운(Kiosk, Mega, GoogleDrive, goFile)
// @version      new 2.3
// @author       김머시기
// @match        https://kiosk.ac/c/*
// @match        https://kio.ac/c/*
// @match        https://kone.gg/*
// @match        https://arca.live/b/*
// @match        https://mega.nz/*
// @match        https://gofile.io/d/*
// @match        https://workupload.com/*
// @match        https://drive.google.com/file/d/*
// @match        https://drive.google.com/drive/folders/*
// @match        https://drive.usercontent.google.com/download?id*
// @icon         https://lh3.google.com/u/0/d/18OVO7VmnwIuHK6Ke-z7035wKFmMKZ28W=w1854-h959-iv1
// @grant        GM.setValue
// @grant        GM.getValue
// @require      https://openuserjs.org/src/libs/sizzle/GM_config.js
// @grant        GM.registerMenuCommand
// @grant        GM_registerMenuCommand
// @grant        GM_unregisterMenuCommand
// @grant        GM_getValue
// @grant        GM_setValue
// @license      MIT
// @run-at       document-end
// ==/UserScript==
'use strict';
let chkp = [,,,, atob('c29taXNvZnQ=')], Down_Option, PageLoading = [], isT = [,,], MenuID = [null, null], host = document.URL.split('/')[2], pw = [atob('c29taXNvZnQ='),atob('c21wZW9wbGU='),
// =============================== Settings =======================================
// 추가하길 원하는 비밀번호 따옴표 - 쉼표로 구분해서 바로 아래줄에 넣으면 됨 ex) '1234', '2024국룰', '!국룰!'

];
PageLoading[0] = 1000;      // 페이지 로딩 시간 조절 (1000당 1초)
Down_Option = 0;           // Kiosk 다운로드 옵션 0:Basic, 1:Fast, 2:일괄 다운로드
// ======================================================================================
async function toggleDown(){
	isT[0]=!isT[0];
	if(!isT[0] && isT[1]){
		isT[1]=false;
		await GM.setValue('isT[1]', isT[1]);
	}
	await GM.setValue('isT[0]', isT[0]);
	updateDown();
	updateTab();
}
async function toggleTab(){
	isT[1]=!isT[1];
	if(!isT[0] && isT[1]){
		isT[0]=true;
		await GM.setValue('isT[0]', isT[0]);
	}
	await GM.setValue('isT[1]', isT[1]);
	updateDown();
	updateTab();
}
function updateDown(){
	if(MenuID[0] !==null)GM_unregisterMenuCommand(MenuID[0]);
	MenuID[0]=GM_registerMenuCommand(`자동 다운로드  ${isT[0] ? 'ON' : 'OFF'}`, toggleDown, { autoClose: false, title: `자동 다운로드 ${isT[0] ? '켜짐' : '꺼짐'}`});
}
function updateTab(){
	if(MenuID[1] !==null)GM_unregisterMenuCommand(MenuID[1]);
	MenuID[1]=GM_registerMenuCommand(`자동 탭 닫기  ${isT[1] ? 'ON' : 'OFF'}`, toggleTab, { autoClose: false, title: `자동 탭 닫기 ${isT[1] ? '켜짐' : '꺼짐'}`});
}
function doDec() {
    if (chkp[3] !== chkp[4]) return;

    let targets = [];

    if (host === 'arca.live') {
        targets = [
            document.querySelector('body div.article-body > div.fr-view.article-content'),
            ...document.querySelectorAll('div.article-comment#comment, div.article-comment')
        ];
    } else if (host === 'kone.gg') {
        const base = document.querySelector('div.prose.prose-invert');
        const comments = document.querySelectorAll('p.text-sm.max-w-xl.whitespace-pre-wrap');
        const listItems = document.querySelectorAll('ol.list-decimal li p');
        targets = [base, ...comments, ...listItems];
    }

    function dec(target, reg) {
        try {
            const original = target.innerHTML;
            const matches = [...original.matchAll(reg)];
            if (matches.length === 0) return;

            let result = original;
            for (const match of matches) {
                let encoded = match[0];
                let decoded = encoded;
                try {
                    while (!decoded.startsWith('http')) {
                        decoded = atob(decoded);
                    }
                    const linkHTML = `<a href="${decoded}" target="_blank" rel="noreferrer" style="color:#1e90ff; text-decoration:none;">${decoded}</a>`;
                    result = result.replace(encoded, linkHTML);
                } catch (e) {
                    console.log('복호화 실패:', encoded, e);
                }
            }
            target.innerHTML = result;
        } catch (e) {
            console.log('dec 함수 에러:', e, target);
        }
    }

    for (const target of targets) {
        if (!target) continue;
        dec(target, /aHR0c[0-9A-Za-z+/=]{8,}/g);
        dec(target, /YUhSMG[0-9A-Za-z+/=]{8,}/g);
        dec(target, /WVVoU[0-9A-Za-z+/=]{8,}/g);
        dec(target, /V1ZWb[0-9A-Za-z+/=]{8,}/g);
    }

    setTimeout(doDlsiteContextAware, 100);
}



function doDlsiteContextAware() {
    let atc;
    if (host === 'arca.live') {
        atc = document.querySelector('.article-body .article-content');
    } else if (host === 'kone.gg') {
        atc = document.querySelector('div.prose.prose-invert');
    }
    if (!atc) return;

    let titleEl;
    if (host === 'arca.live') {
        titleEl = document.querySelector('.title-row .title') || document.querySelector('.board-title .title');
    } else if (host === 'kone.gg') {
        titleEl = [...document.querySelectorAll('h1')].find(el =>
            el.textContent?.match(/RJ[0-9]{6,10}/i)
        );
    }

    const keywordPattern = /(꺼|거|퍼|RJ|rj|Rj|rJ|VJ|vj|Vj|vJ|DL|dl|Dl|dL)[\s:()\[\]#-]*([0-9]{6,10})/g;
    const fullRJPattern = /\b(RJ|rj|Rj|rJ|VJ|vj|Vj|vJ|퍼|꺼|거|DL|dl|Dl|dL)([0-9]{6,10})\b/g;

    let titleText = '';
    if (titleEl?.childNodes) {
        titleText = Array.from(titleEl.childNodes)
            .map(n => n.textContent.trim())
            .join(' ');
    }

    const bodyText = atc.textContent || '';
    const fullText = titleText + '\n' + bodyText;

    const matchList1 = [...fullText.matchAll(keywordPattern)].map(m => ({ prefix: m[1], code: m[2] }));
    const matchList2 = [...fullText.matchAll(fullRJPattern)].map(m => ({ prefix: m[1], code: m[2] }));

    const linkCodes = Array.from(atc.querySelectorAll('a[href]'))
        .map(a => {
            const match = a.href.match(/(RJ|VJ)([0-9]{6,10})/i);
            return match ? { prefix: match[1].toUpperCase(), code: match[2] } : null;
        })
        .filter(Boolean);

    const splitNodeMatches = [];
    const allNodes = [...atc.querySelectorAll('*')];
    const validPrefixes = ['꺼','거','퍼','RJ','rj','Rj','rJ','VJ','vj','Vj','vJ','DL','dl','Dl','dL'];

    for (const node of allNodes) {
        const children = [...node.childNodes];
        for (let i = 0; i < children.length - 1; i++) {
            const a = children[i], b = children[i + 1];
            const aText = (a.textContent || '').replace(/\s+/g, '');
            const bText = (b.textContent || '').trim();
            if (!/^\d{6,10}$/.test(bText)) continue;
            for (const prefix of validPrefixes) {
                if (aText.includes(prefix)) {
                    splitNodeMatches.push({ prefix, code: bText });
                    break;
                }
            }
        }
    }

    const extraFromTitle = [];
    const match = titleText.match(/^[\[]?([0-9]{6,10})[\]]?/);
    if (match) extraFromTitle.push({ prefix: 'RJ', code: match[1] });

    const allCodes = [
        ...matchList1,
        ...matchList2,
        ...linkCodes,
        ...splitNodeMatches,
        ...extraFromTitle
    ];

    const seen = new Set();
    const uniqueCodes = allCodes.filter(({ code }) => {
        if (seen.has(code)) return false;
        seen.add(code);
        return true;
    });

    if (uniqueCodes.length === 1) {
        const { code, prefix } = uniqueCodes[0];
        if (!code) return;

        const mappedPrefix = ['vj', 'vJ', 'Vj', 'VJ', '퍼'].includes(prefix.toLowerCase()) ? 'VJ'
                            : ['rj', 'rJ', 'Rj', 'RJ', '꺼', '거', 'dl', 'dL', 'Dl', 'DL'].includes(prefix.toLowerCase()) ? 'RJ'
                            : prefix.toUpperCase();

        const fullCode = `${mappedPrefix}${code}`;
        const link = `https://www.dlsite.com/maniax/work/=/product_id/${fullCode}.html`;

        const existing = atc.querySelector('.dlsite-link-appended');
        if (existing) existing.remove();

        const wrapper = document.createElement('div');
        wrapper.className = 'dlsite-link-appended';
        wrapper.style.marginTop = '15px';
        wrapper.style.padding = '10px 0';
        wrapper.style.borderTop = '1px dashed #aaa';

        const a = document.createElement('a');
        a.href = link;
        a.target = '_blank';
        a.rel = 'noreferrer';
        a.textContent = `[DLsite] ${fullCode}`;
        a.style.display = 'block';
        a.style.marginBottom = '5px';
        a.style.color = '#1e90ff';

        wrapper.appendChild(a);
        atc.appendChild(wrapper);
        return;
    }

    const combinedPattern = new RegExp(`${keywordPattern.source}|${fullRJPattern.source}`, 'gi');

    const walk = (node) => {
        if (node.nodeType === Node.TEXT_NODE) {
            const text = node.textContent;
            let lastIndex = 0;
            let match;
            const frag = document.createDocumentFragment();

            while ((match = combinedPattern.exec(text)) !== null) {
                const before = text.slice(lastIndex, match.index);
                const number = match[2] || match[4];
                const prefix = (match[1] || match[3] || '').toLowerCase();
                const mappedPrefix = ['vj', 'vJ', 'Vj', 'VJ', '퍼'].includes(prefix) ? 'VJ'
                                        : ['rj', 'rJ', 'Rj', 'RJ', '꺼', '거', 'dl', 'dL', 'Dl', 'DL'].includes(prefix) ? 'RJ'
                                        : prefix.toUpperCase();
                const fullCode = `${mappedPrefix}${number}`;

                const a = document.createElement('a');
                a.href = `https://www.dlsite.com/maniax/work/=/product_id/${fullCode}.html`;
                a.textContent = fullCode;
                a.target = '_blank';
                a.rel = 'noreferrer';
                a.style.color = '#1e90ff';

                if (before) frag.appendChild(document.createTextNode(before));
                frag.appendChild(a);
                lastIndex = match.index + match[0].length;
            }

            if (lastIndex < text.length) {
                frag.appendChild(document.createTextNode(text.slice(lastIndex)));
            }

            if (frag.childNodes.length > 0) {
                node.replaceWith(frag);
            }
        } else if (
            node.nodeType === Node.ELEMENT_NODE &&
            !['A', 'SCRIPT', 'STYLE'].includes(node.tagName)
        ) {
            for (const child of [...node.childNodes]) {
                walk(child);
            }
        }
    };

    walk(atc);
}




async function chkPW(){
	chkp[3]=await GM.getValue('chkp[3]');
	isT[0]=await GM.getValue('isT[0]', true);
	isT[1]=await GM.getValue('isT[1]', false);
	updateDown();
	updateTab();
	if(host=='arca.live' || host=='kone.gg'){
		if(chkp[3] !=chkp[4]){
			const chk=prompt(decodeURI(atob('JUVBJUI1JUFEJUVCJUEzJUIwJUVEJTk5JTk1JUVDJTlEJUI4')));
			if(chk?.toLowerCase()==chkp[4]) await GM.setValue('chkp[3]', chkp[4]);
			else {
				GM.setValue('chkp[3]', false);
				alert(decodeURI(atob('JUVBJUI1JUFEJUVCJUEzJUIwJUVDJTlEJUI0JTIwJUVDJTlEJUJDJUVDJUI5JTk4JUVEJTk1JTk4JUVDJUE3JTgwJTIwJUVDJTk1JThBJUVDJThBJUI1JUVCJThCJTg4JUVCJThCJUE0')));
			}
		}
	}
}
async function inputPW(){
	let inputElem=document.querySelector(chkp[0]), btnElem=document.querySelector(chkp[1]);
	if(chkp[3]==chkp[4]){
		try {
			for(let i=0; i < pw.length; i++){
				if(host=='kio.ac'){
					inputElem.value=pw[i];
					inputElem.dispatchEvent(new Event('input', { bubbles: true }));
					inputElem.dispatchEvent(new Event('change', { bubbles: true }));
					setTimeout(()=> {btnElem.click()}, 10);
				} else {
					inputElem.value=pw[i];
					btnElem.click();
				}
				if(i < pw.length - 1){ if(pw[i] !=null && pw[i] !='')await new Promise(res=> setTimeout(res, 800));
				} else { if(isT[0]==true)await setTimeout(DBtn, PageLoading[1]); }
			}
		} catch(e){ await setTimeout(DBtn, PageLoading[1]); }
	}
}
async function kioskdone(){
	try {
		await new Promise(res=> setTimeout(res, 3000));
		for(var i=0, jj=0; jj!=1; i++){
			console.log(i);
			await new Promise(res=> setTimeout(res, 1000));
			if(document.querySelector('.flex.flex-row.text-xs.justify-between div:nth-child(2)').innerText=='done'){
				console.log(i);
				await setTimeout(()=> { window.open('', '_self').close()}, 2000);
				jj++;
			}
		}
	} catch(e){ if(isT[1]==true && isT[2]==true)setTimeout(()=> { window.open('', '_self').close()}, 1000); }
}
async function DBtn(){
	if(isT[0] !== true) return; // 수정 1: 자동 다운로드 OFF 시 즉시 종료
	if(host=='mega.nz')await document.querySelector('.mega-button.positive.resume.js-resume-download').click();
	try {
		let btns = document.querySelectorAll(chkp[2]);
		let delayMultiplier = PageLoading[0] + 600;
		if(btns.length > 1){
			btns.forEach((btn, index) => {
				setTimeout(() => { btn.click(); }, index * delayMultiplier);
			});
		} else if(btns.length === 1){
			btns[0].click();
		}
		if(host=='mega.nz')
			await setTimeout(()=> { document.querySelector('.mega-button.large.positive.download.continue-download').click()}, 2000);
		if(isT[1]==true && isT[2]==true){ // 수정 2: 자동 탭 닫기 kio.ac 포함
			let totalDelay = (btns.length > 1) ? (btns.length * delayMultiplier + 700) : 1300;
			if(host=='kiosk.ac'){
				setTimeout(()=> { kioskdone(); }, totalDelay);
			} else if(host=='kio.ac'){
				setTimeout(()=> { window.open('', '_self').close()}, totalDelay+1000);
			} else {
				setTimeout(()=> { window.open('', '_self').close()}, totalDelay);
			}
		}
	}catch(e){ console.log(e); }
}
function FindPW(){
  let atc;
if (host === 'arca.live') {
    atc = document.querySelector('body div.article-body > div.fr-view.article-content');
} else if (host === 'kone.gg') {
    atc = document.querySelector('div.prose.prose-invert');
}
if (!atc) return;
	atc.innerHTML=atc.innerHTML.replace(/(&nbsp;)/g, ' ');
	atc.innerHTML=atc.innerHTML.replace(/국룰/g, 'ㄱㄹ');
	let rgx=/[(<p>)]{0,0}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}(ㄱㄹ){1,}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#($)%&=\(\)(&nbsp;)]{0,}[(</p>)]{0,0}/;
	let regexx=/(대문자)/;
	if(regexx.test(regexx.exec(atc.innerHTML))===true)pw[pw.length]=atob('U01QRU9QTEU');
	function dec(reg){
		try {
			while(reg.test(atc.innerHTML)){
				let DECed=reg.exec(atc.innerHTML)[0].replace(/(ㄱㄹ)/g, '국룰');
				let DECedd=DECed.replace(/\s|[+]|(&nbsp;)|은|는|이|(전부)|(대문자로)|(대문자)|(비밀번호)|(패스워드)|(비번)|(ㅂㅂ)|(암호)|(ㅇㅎ)|(키오스크맘)|(키오스크)/g, '');
				DECedd=DECedd.split(/[(입)(임)(이다)(이고)(이며)(입니다)(임다)(같)(처럼)(틀)]/g)[0];
				let dat=document.querySelector('.date .body').innerText.split(' ')[0];
				let regexa=/(오늘)|(날짜)|(날자)/g;
				if(regexa.test(DECedd)===true){
					DECedd=DECedd.replace(regexa, '');
					let md=[dat.split(/\-/g)[1] + dat.split(/\-/g)[2],dat.split(/\-/g)[1] +'-'+ dat.split(/\-/g)[2],dat.replace(/\-/g, ''),dat];
					for(let i=0;i<4;i++){
						pw[pw.length]=DECedd.replace(/국룰/g,chkp[4])+md[i];
					}
				} else { if(pw.indexOf(DECedd.replace(/국룰/g,chkp[4]))=='-1')pw[pw.length]=DECedd.replace(/국룰/g,chkp[4]); }
				atc.innerHTML=atc.innerHTML.replace(reg, '1ㅂㅁ2ㅈㄴ3ㄷㅇ4ㄱㄹ1qa2ws3ed4rf');
				atc.innerHTML=atc.innerHTML.replace(/(1ㅂㅁ2ㅈㄴ3ㄷㅇ4ㄱㄹ1qa2ws3ed4rf)/g,DECed);
			}
			GM.setValue('pw', pw);
		} catch(e){ console.log(e, atc); }
	}
	dec(/[(<p>)]{0,0}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}(ㄱㄹ){1,1}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}[(</p>)]{0,0}/);
	setTimeout(aaa, 100);
}
function waitForKoneContent() {
    const checkInterval = setInterval(() => {
        const atc = document.querySelector('div.prose.prose-invert');
        const titleEl = [...document.querySelectorAll('h1.flex, h1.text-xl')].find(el =>
            /RJ[0-9]{6,10}|VJ[0-9]{6,10}/i.test(el.textContent)
        );

        const hasBase64 = atc && /aHR0c|YUhSMG|WVVoU|V1ZWb/.test(atc.textContent);

        if (atc && titleEl && hasBase64) {
            clearInterval(checkInterval);
            FindPW();
            setTimeout(doDec, 300);  // 렌더링 안정화 후 복호화
        }
    }, 300);  // 0.3초 간격 체크
}



async function aaa(){ pw=await GM.getValue('pw'); }
chkPW();

if (host === 'arca.live') {
    FindPW();
    setTimeout(doDec, 10); // 그대로 빠르게 실행
} else if (host === 'kone.gg') {
    setTimeout(waitForKoneContent, PageLoading[0]);
}


if(host=='kio.ac'){
	aaa();
	chkp[0]='.overflow-auto.max-w-full.max-h-full.flex-grow.p-1 input:nth-of-type(1)';
	chkp[1]='.flex.flex-col-reverse button:nth-of-type(1)';
	chkp[2]='.p-2.align-middle .flex.align-middle button:nth-of-type(1)';
	isT[2]=true;
	PageLoading[1]=3500;
	setTimeout(inputPW, PageLoading[0] + 2000);
}
if(host=='mega.nz'){
	aaa();
	chkp[0]='#password-decrypt-input';
	chkp[1]='.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button';
	chkp[2]='.mega-button.positive.js-default-download.js-standard-download';
	PageLoading[1]=4000;
	isT[2]=false;
	setTimeout(inputPW, PageLoading[0] + 1800);
}
if(host=='kiosk.ac'){
	aaa();
	chkp[0]='.input.shadow-xl.flex-grow';
	chkp[1]='.btn.btn-ghost.w-full.mt-2.rounded-md';
	if(Down_Option==2)
		chkp[2]='.flex.justify-between.w-full .flex.gap-2 .btn.btn-ghost';
	else
		chkp[2]='#vexplorer-body .hover.cursor-pointer .flex .dropdown.group button';
	if(Down_Option==0)
		isT[2]=true;
	else
		isT[2]=false;
	PageLoading[1]=3000;
	setTimeout(inputPW, PageLoading[0]);
}
if(host=='workupload.com'){
	aaa();
	chkp[0]='#passwordprotected_file_password';
	chkp[1]='#passwordprotected_file_submit';
	chkp[2]='.btn.btn-prio';
	if(Down_Option==0)
		isT[2]=true;
	else
		isT[2]=false;
	PageLoading[1]=2000;
	setTimeout(inputPW, PageLoading[0]);
}
if(host=='drive.google.com'){
	aaa();
	if(document.URL.split('/')[3] + document.URL.split('/')[4]=='filed')
		window.location.href=`https://drive.usercontent.google.com/download?id=${document.URL.split('/')[5]}&export=download`;
	if(document.URL.split('/')[3] + document.URL.split('/')[4]=='drivefolders'){
		setTimeout(()=> { if(isT[0]==true)setTimeout(()=> { document.querySelector('.pc7nUb.kXQBpc.Dk9rmd:nth-child(2)').click()}, 1500)}, PageLoading[0]);
		chkp[2]='.h-De-Vb.h-De-Y';
		PageLoading[1]=1;
		isT[2]=true;
		setTimeout(()=> { if(isT[0]==true)setTimeout(DBtn, 3500)}, PageLoading[0]);
	}
}
if(host=='drive.usercontent.google.com'){
	aaa();
	chkp[2]='.goog-inline-block.jfk-button.jfk-button-action';
	isT[2]=true;
	setTimeout(()=> { if(isT[0]==true)DBtn()}, 1);
}
if(host=='gofile.io'){
	aaa();
	chkp[0]='#filesErrorPasswordInput';
	chkp[1]='#filesErrorPasswordButton';
	chkp[2]='.btn.btn-outline-secondary.btn-sm.p-1.text-white';
	PageLoading[1]=3000;
	isT[2]=true;
	setTimeout(inputPW, PageLoading[0]);
}
(function () {
    'use strict';

    if (location.host !== 'kone.gg') return;

    let lastUrl = location.href;

    const observer = new MutationObserver(() => {
        const currentUrl = location.href;
        if (currentUrl !== lastUrl) {
            lastUrl = currentUrl;
            observeAndRun();
        }
    });

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

    function observeAndRun() {
        const start = Date.now();
        const timeout = 8000;

        const timer = setInterval(() => {
            const atc = document.querySelector('div.prose.prose-invert');
            const hasText = atc && atc.textContent.length > 20;
            const hasEncoded = atc && /aHR0c|YUhSMG|WVVoU|V1ZWb/.test(atc.textContent);

            if (hasText && hasEncoded) {
                clearInterval(timer);
                FindPW();
                setTimeout(() => {
                    doDec();
                    doDlsiteContextAware();
                }, 300);
            }

            if (Date.now() - start > timeout) {
                clearInterval(timer);
            }
        }, 300);
    }

    observeAndRun(); // 초기 진입 시 실행
})();