kone
소미소프트

소미소프트

코네 이미지 뷰어 개선 스크립트

09/06/2025, 08:00:40
유틸
4290 views · 10 likes

코네 자체 이미지 뷰어에 전체화면이 없어서 간단하게 AI 사용해서 만들어봤음

이미지 완전 전체화면 + 마우스(한손)으로 모든 조작 or 키보드로 조작 가능


사용법:

0. Tampermonkey 확장프로그램 설치 후, + 버튼으로 아래 내용 복붙


1. 이미지 클릭해서 기존처럼 뷰어열기

2. 우상단 전체화면 버튼 or 키보드 I키 누르기로 전체화면

1

3. 우상단 X버튼 클릭 or I키로 전체화면 및 이미지뷰어 탈출

1


방향키, 마우스 휠로 이미지 이동 가능


aHR0cHM6Ly9raW8uYWMvYy9kMml2bk1FR25EUTV6X3RQcWpoUEti



코드 보기
// ==UserScript==
// @name         Kone.gg 뷰어 확장 기능
// @namespace    https://kone.gg/
// @version      1.9
// @description  'i' 키/버튼으로 뷰어/전체화면 제어, 전체화면 나가기 버튼으로 뷰어 동시 닫기, 이미지 전환 애니메이션 제거 기능을 제공합니다.
// @author       AI Assistant & User
// @match        https://kone.gg/*
// @grant        GM_addStyle
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const SCRIPT_ID = 'konegg-ui-toggle-script';

    // === 스타일 주입 ===
    GM_addStyle(`
        /* UI 숨김 스타일 */
        .viewer-container.ui-hidden .viewer-header,
        .viewer-container.ui-hidden .viewer-footer {
            display: none !important;
        }

        /* Swiper 뷰어 슬라이드 애니메이션 제거 */
        .swiper-wrapper {
            transition-duration: 0.001s !important;
        }

        /* 전체화면 나가기 버튼 스타일 */
        #exit-fullscreen-button {
            position: fixed;
            top: 1rem;
            right: 1rem;
            z-index: 2147483647;
            display: none;
            width: 48px;
            height: 48px;
            background-color: rgba(0, 0, 0, 0.4);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            cursor: pointer;
            align-items: center;
            justify-content: center;
        }
        #exit-fullscreen-button:hover {
            background-color: rgba(0, 0, 0, 0.7);
        }
    `);

    // === 기능 함수 ===
    const toggleUI = (container) => {
        if (container) {
            container.classList.toggle('ui-hidden');
        }
    };

    const setupViewer = (viewerContainer) => {
        if (viewerContainer.dataset.uiToggleSetup === 'true') return;
        viewerContainer.dataset.uiToggleSetup = 'true';
        viewerContainer.classList.add('viewer-container');

        const header = viewerContainer.querySelector('div.flex.w-full.justify-end');
        if (!header) return;

        header.classList.add('viewer-header');
        const footer = viewerContainer.querySelector('div.flex.flex-col.md\\:flex-row');
        if (footer) footer.classList.add('viewer-footer');

        // 전체화면 버튼 추가 (이미 있다면 추가하지 않음)
        if (!header.querySelector('.fullscreen-btn')) {
            const closeButton = header.querySelector('button:last-child');
            if (closeButton) {
                const fullscreenButton = document.createElement('button');
                fullscreenButton.className = `${closeButton.className} fullscreen-btn`;
                fullscreenButton.innerHTML = ``;
                fullscreenButton.onclick = (e) => {
                    e.stopPropagation();
                    if (!document.fullscreenElement) {
                        document.documentElement.requestFullscreen();
                    }
                };
                header.insertBefore(fullscreenButton, closeButton);
            }
        }

        // UI 토글 버튼 이벤트 설정
        const gridButton = header.querySelector('button');
        if (gridButton && !gridButton.dataset.uiToggleEvent) {
             gridButton.dataset.uiToggleEvent = 'true';
             gridButton.addEventListener('click', (e) => {
                e.preventDefault();
                e.stopPropagation();
                toggleUI(viewerContainer);
            }, true);
        }
    };

    // === 스크립트 초기 실행 로직 ===
    if (document.getElementById(SCRIPT_ID)) return;

    const scriptMarker = document.createElement('div');
    scriptMarker.id = SCRIPT_ID;
    scriptMarker.style.display = 'none';
    document.body.appendChild(scriptMarker);

    if (!document.getElementById('exit-fullscreen-button')) {
        const exitFullscreenButton = document.createElement('button');
        exitFullscreenButton.id = 'exit-fullscreen-button';
        exitFullscreenButton.innerHTML = ``;

        // [수정됨] 'X' 버튼 클릭 시 전체화면 해제 및 뷰어 닫기
        exitFullscreenButton.onclick = () => {
            if (document.fullscreenElement) {
                // 1. 전체화면 해제
                document.exitFullscreen();

                // 2. 뷰어를 찾아 닫기 버튼을 클릭
                const viewer = document.querySelector('.viewer-container');
                if (viewer) {
                    const closeButton = viewer.querySelector('.viewer-header button:last-child');
                    if (closeButton) {
                        closeButton.click();
                    }
                }
            }
        };
        document.body.appendChild(exitFullscreenButton);
    }


    // === 이벤트 리스너 ===
    const observer = new MutationObserver((mutationsList) => {
        for (const mutation of mutationsList) {
            if (mutation.addedNodes.length) {
                const viewerContainer = document.querySelector('div.fixed.z-50 div.swiper')?.closest('div.fixed.z-50');
                if (viewerContainer) {
                    setupViewer(viewerContainer);
                }
            }
        }
    });

    document.addEventListener('keydown', (e) => {
        const activeElement = document.activeElement;
        const isTyping = activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable);
        if (isTyping) return;

        if (e.key.toLowerCase() === 'i') {
            e.preventDefault();
            const viewer = document.querySelector('.viewer-container:not([style*="display: none"])');

            if (viewer) { // 뷰어가 열려있을 때
                if (document.fullscreenElement) {
                    document.exitFullscreen();
                    const closeButton = viewer.querySelector('.viewer-header button:last-child');
                    if (closeButton) closeButton.click();
                } else {
                    document.documentElement.requestFullscreen();
                }
            } else { // 뷰어가 닫혀있을 때
                 const openViewerButton = Array.from(document.querySelectorAll('div[role="menuitem"]'))
                                             .find(item => item.textContent.trim() === '뷰어 열기');
                if (openViewerButton) {
                    openViewerButton.click();
                    setTimeout(() => {
                         if (!document.fullscreenElement) {
                             document.documentElement.requestFullscreen().catch(err => {});
                         }
                    }, 100);
                }
            }
        }
    });

    document.addEventListener('fullscreenchange', () => {
        const currentViewer = document.querySelector('.viewer-container');
        const exitBtn = document.getElementById('exit-fullscreen-button');

        if (document.fullscreenElement) {
            if (currentViewer) currentViewer.classList.add('ui-hidden');
            if (exitBtn) exitBtn.style.display = 'flex';
        } else {
            if (currentViewer) currentViewer.classList.remove('ui-hidden');
            if (exitBtn) exitBtn.style.display = 'none';
        }
    });

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




10
12 comments
09/06/25
09/06/25
모바일은 확장 프로그램 못쓰는게 슬플 따름...
09/06/25 Edited 09/06/25
모바일도 안드로이드 쓰면 확프나 유저스크립트 쓸 수 있어!
04/27 Edited 04/27

Deleted comment.

04/27 Edited 04/27

Deleted comment.

04/27 Edited 04/27

Deleted comment.

(일부직번) [Gagarin Kichi] 빼앗긴 폭유 아내 시리즈 -총집편-
동인
kason
05/22 26046 129
[ai번역][Itaba Hiroshi] 자매들의 속사정 [p.203]
동인
mybest
05/22 16663 50
[요청복구] [한글자막] 뉴 짱, 완전 타락 2편 ~이거, 네『원래』인격이야~ (0편~6편)
영상
jeonwol
05/22 24097 113
비월선행록 1.29 개조버전 수정 알림
번역
V
05/22 48744 301
(스압 약간털 요괴 체격차이) [Okuva] Onimara 오니마라
동인
tawarahiryuu
05/22 16352 54
정위치
동인
에우리알레
05/22 13062 57
[구매보급] RJ436659 히프노시스 레이무 v1.14
미번
r4gsdrg
05/22 10751 31
[후원보급] U2hhbXVNTUQ 모음집
영상
hannanas
05/22 19622 71
TU1EdHlwZTg3 모음집 업데이트 알림
영상
hannanas
05/22 17110 49
(미번,구매보급,이종간)エクスタシーアリーナ~淫紋に封じられし最強剣姫~
미번
kogi1966
05/22 11276 38
청아,버)의외로 꼴리는 상황
야짤
gpsel157
05/22 9621 23
[ai번역][Itaba Hiroshi] 여동생이랑 해버렸는데, 여동생 친구랑도 해버렸다. (p.201)
동인
mybest
05/22 29408 71
The Censor DLC 5.27 배포 시작
정보
네르이스
05/22 8613 26
[구매보급]【승리의 여신: 니케】ASMR - 저녁 하늘 아래, 너라는 첫 별과 함께【아니스 : 스타】한국어판
소리
Seza
05/22 15078 151
[업데이트 안내] [itch버전] 존재감 없는 여동생과의 소박한 일상 1.1.1rev2 + 안드로이드 포함
번역
kkkkkk0909
05/22 38573 160
[구매보급]【승리의 여신: 니케】ASMR - 한철 붉게 피어나는 마음【홍련】한국어판
소리
Seza
05/22 14608 154
[ai번역][Itaba Hiroshi] 강압적으로 들이대는 모성 넘치는 호나미 씨 [p.201]
동인
mybest
05/22 14349 45
ai, 원신) 클로린드를 함락시키기 위한 결투를 신청했다
야짤
kjh9304
05/22 8572 89
[미번,구매보급,이종간,번역요청] 姫騎士エレーナ-淫欲のダンジョンに囚われて-(RJ01626482)
미번
gumjeongpan
05/22 19374 100
[구매보급/번역요청][청아/출산/충간] RJ01630058)시골의 돈 낚시
미번
flatune
05/22 21583 88
치안 붕괴!! 여경은 목숨 구걸 아부 육변기 Chian Houkai!! Fukei-san wa Inochigoi Sontaku Nikubenki
동인
shiroi
05/22 33760 175
[ai번역][Itaba Hiroshi] Shinseki Midara My Home Harem 음란한 친척 내집 하렘 [p.227]
동인
mybest
05/22 17692 66
[ai번역][완결][한글패치만] Downfall: A Story of Corruption [v0.16.0]
번역
aahit
05/22 25003 87
[보이스 코믹][한글 자막]따끈 따끈한 흑갸루 오네쇼타
소리
ghkdw
05/21 12568 129
청아]개씹 도트갓겜발매라서 봐봤는데 ㅋㅋㅋㅋㅋㅋ
정보
여동생킬러
05/21 18556 30
[구매보급]수수하고 소극적인 도서위원인 줄 알았는데,발정하면 오호교미하는 여자였다
소리
이름뭐하지
05/21 8273 47
[Higenamuchi] 카츠라씨의 일상 성활 (NTR)
동인
질겨찾기
05/21 17079 57
야겜뉴비의 매우 주관적인 게임 한 줄 평과 평점 모음 1탄
후기 및 공략
pegets
05/21 12821 32
[청아][번역][모자파괴] 이타즈러브 - 인적 없는 공원에서 소녀와 사랑을 키우자
번역
ilillilllilil
05/21 40632 259
[Danimaru/노모] 하룻밤 재워줄래, 오타쿠 군♥
동인
ㅇㅇ
05/21 36299 261