kone
소미소프트

소미소프트

전체글 버튼을 만들어주세요

05/27/2025, 07:00:13
유틸
3231 views · 6 likes

하루종일 글 읽고 다시 전체 글목록으로 돌아가는데 좀 편하게 하고 싶어서 스크립트 싸옴


1


곧 고쳐질거같아서 과도기에나 잠깐 쓸법하여 그냥 코드로만 배포함

본인 css는 잘몰라서 그냥 대충 옆에 버튼 배껴 쓴거니까 잘못됐다 싶은건 classes 에서 삭제해서 사용하셈


greasemonkey, tampermonkey, violentmonkey 사용중이라면 아래 코드 임포트후 사용하면 되시겠다

무슨말인지 모르겠다면 무시


추가 >> ㅈㅅㅈㅅ 제일 아래에도 개념글 버튼이 있는 걸 모르고 리스트 상위에만 버튼 넣었음

버전 0.2로 업데이트 했읍니다


// ==UserScript==
// @name         make all article button
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  전체 글 호출 
// @match        https://kone.gg/s/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function () {
    'use strict';

    function buildButton() {
        const classes = "focus-visible:border-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:hover:bg-input/50 flex items-center justify-between gap-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 border-zinc-300 focus-visible:ring-1 focus-visible:ring-blue-500 dark:border-zinc-600 cursor-pointer !h-8 p-0 rounded-full bg-zinc-100 dark:bg-zinc-700 border-0 px-3";
        return `<button data-slot="button" data-added="all" class="${classes}">전체글</button>`;
    }

    function getSubUrl() {
        return location.origin + location.pathname.match(/^\/s\/[^\/]+/)[0];
    }

    function attachButton() {
        const anchors = Array.from(document.querySelectorAll('a > button'))
            .filter(btn => btn.textContent.includes('개념글'))
            .map(btn => btn.parentElement);

        if (!anchors.length) return false;

        anchors.forEach(anchor => {
            const btnParent = anchor.parentElement;
            if (!btnParent) return;

            if (btnParent.querySelector('button[data-slot="button"][data-added="all"]')) return;

            const wrapper = document.createElement('a');
            wrapper.href = getSubUrl();
            wrapper.innerHTML = buildButton();

            btnParent.insertBefore(wrapper, anchor);
        });

        return true;
    }


    const observer = new MutationObserver(() => {
        attachButton();
    });
    observer.observe(document.body, {
        childList: true,
        subtree: true,
    });
})();

6
4 comments
05/27/25
이거 ㄹㅇ 필요했음
좋네용 애초에 개념글이랑 전체글 버튼을 분리해놨으면 좋앗을텐데..
05/27/25
당신같은 남자를 기다려왔다우
05/27/25
와우.. 능력자
마나카 릴리스 모드 번역
유틸
죽지않아
02/16 11334 6
청아)시니2 하냐 컨텐츠 더 추가해줬으면
유틸
cascastu
02/16 10363 11
[요청복구] Prison Hero 감옥용사 조이플 구동패치
유틸
감비아
02/16 9068 5
SecretFlasher.VoicePack-Plus 마나카 음성모드 개인수정(로우튠 등)
유틸
leedi
02/16 24558 26
GameDB 배포
유틸
심심한개발자
02/15 8782 11
기번 너스콜 선택지 ㅁㅁㅁ로 뜨는 문제 해결 필요한사람 가져가세요
유틸
tyrocsx
02/13 10319 16
[노모패치] RJ274510 이누히메 1.07
유틸
panzer
02/13 16409 27
프린세스 시너지 전용치트
유틸
4HHHH
02/13 9660 11
안돼! 동거 라이프 세이브파일 에디트 (파이썬)
유틸
jghkk9
02/12 8269 2
[노모패치] RJ01302356 리리네와 연금술사
유틸
bubblegum
02/12 11948 9
f95에 올라온 RJ01550550 프린세스 시너지 완전 노모개조파일 있는데
유틸
pd99990
02/12 21847 34
comfyui를 이용해서 만화를 자동채색+검열제거 해보자
유틸
프로베스트캣
02/12 17450 48
시니시스타2 내 취향 가득 들어간 핑챙 자작 모드 (1.2.1 ver)
유틸
cascastu
02/11 22814 85
90일, 복구) 유니티6 번역세트.zip 갱신 26.03.21
유틸
ㅇㅇ
02/10 9376 19
유니티 기계번역 딸각툴
유틸
Ghost
02/10 9124 10
ProjectR v0.7.0.0 무검열 패치(수정)
유틸
choi-good
02/10 13807 20
프린세스 시너지 전용치트
유틸
4HHHH
02/10 11582 10
[요청복구] RJ01453643 [PlumSoftware] 네토라세에 능숙한 야마다씨 (이미지번역)
유틸
류제로
02/09 8209 9
[요청복구] RJ01511074 사쿠라코 네토라레담 타이틀 및 이미지 번역 (3차 수정_찐최종) 2026.02.09 게시물 수정함
유틸
류제로
02/06 19205 18
삼국지8 리메이크 PK 여성화 하렘 (149명 패치) 1.1.0버전용
유틸
크로우
02/05 21465 64
감옥용사 조이플 구동패치
유틸
ssddttj
02/05 8157 3
코캇 버) 프리셋 (모드포함)
유틸
pst0025
02/05 14331 29
[요청복구] [1.10으로 암호화 다시함] [이미지번역](에로스테만) RJ01522194 NTR히로인 화이트스노우
유틸
류제로
02/04 8678 14
모모 크래시 ver.1.60 (26.02.02)
유틸
미스터장
02/04 8512 5
[노모패치만] 여름의 뒤편에서
유틸
미스터장
02/03 14685 30
🔞슬레이 더 스파이어 NSFW 모드 올인원 (5.12 갱신)
유틸
Rasmodia
02/03 46927 112
터널탈출FE 0.18.0a 복호화
유틸
wqddsag
02/03 12336 6
MV 번역 이식 도구 파이썬 코드
유틸
lovesccubus
02/03 11532 5
[DLC만] 세계수의 무녀 ~거리 한복판에서 만지기 무제한 & 에로 트랩으로 갸루 겟츄~ 【H씬 전부해금 DLC】
유틸
미스터장
02/03 16730 46
차라 키우기
유틸
beplnex
02/01 7986 6