kone
소미소프트

소미소프트

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

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

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



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

본인 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
Sign in to comment
05/27/25
이거 ㄹㅇ 필요했음
좋네용 애초에 개념글이랑 전체글 버튼을 분리해놨으면 좋앗을텐데..
05/27/25
당신같은 남자를 기다려왔다우
05/27/25
와우.. 능력자
Sign in to comment
섀도우버스WB 카드 누패
유틸
나나바
05/27 1792 9
방주 해제 스크립트 공유
유틸
ddiff
05/26 2638 9
unholy maiden seed of profanity모드 1.4
유틸
leessss25
05/26 2073 13
[복구]섹타듀벨리 모드팩
유틸
continuereset
05/26 5099 20
[그냥복구/본체없음] 배덕의 달콤함에 물든 마나카. 여기서 받은 모드팩
유틸
루파조아
05/26 2974 9
FORTUNE BRIDE ~절정개안의 의식~ 노모 패치
유틸
미스터장
05/24 6452 33
(코이카츠) 엔드필드 프리셋 공유
유틸
pst0025
05/23 8777 65
EnigmaVBUnpacker (MV MZ 언팩) 웹버전 오픈
유틸
mrpls
05/23 4207 15
파일/ 압축/ 폴더 제목의 품번 괄호 삭제해주는 유틸
유틸
몬스터가아니다신이다
05/23 2903 2
[패치만] 시니시스타2 따거 MOD
유틸
하우두유두
05/22 14067 50
(수정 사항3)내가 쓸려고 만든 코드 검색용 + 파일관리
유틸
ATTAA
05/21 4027 14
[노모패치] 갓 딴 임신시키기 좋은 날
유틸
나나바
05/21 9807 39
zenpy 폰트 설치기
유틸
thxl23
05/20 3522 6
내가 쓸려고 만든 유틸 프로그램임
유틸
몬스터가아니다신이다
05/20 4120 6
내가 쓸려고 만든 DLsite 코드 검색 용
유틸
ATTAA
05/19 5968 7
내가 쓸려고 만든 유니티 버전별 폰트랑 어디서 구해온거 (오토트랜스용)
유틸
neighborsbear
05/19 6873 4
[요청복구] 감옥용사 1.20 조이플 구동패치
유틸
ssddttj
05/17 3249 5
누군가 쓸 마법의하나 マホウノハナ 0.9e 실시간 번역용 프리패쳐 파일
유틸
ㅇㅇ
05/17 7139 8
키리키리 엔진 ScnEditorGUI 개선판 (scn 암호화 파일 에디터)
유틸
joyed47106
05/16 6718 7
시니시스타 2 업뎃기념 모드 모음
유틸
sims9876
05/16 20896 105
(코이카츠) 버튜버 프리셋 공유 ver.2
유틸
pst0025
05/16 13305 51
(코이카츠) 버튜버 프리셋 공유 (복구)
유틸
pst0025
05/16 14663 64
WebP_Converter 코네 다운로드하다 WebP 불편해서 만든 프로그램
유틸
noname
05/15 13097 16
(코이카츠) 최근에 풀린 프리셋 공유
유틸
pst0025
05/15 12770 34
[RPG Maker MV/MZ 실시간 번역기] 4.0 출시
유틸
mrpls
05/15 22705 70
내가 쓰려고 만든 동음 정리 유틸
유틸
yeppi
05/15 8250 24
Texture Tool for Unity 6 ( Mono / IL2CPP ) v0.1.1 최초 배포 버전
유틸
argoklarke
05/14 15163 28
(코이카츠) 학원마스 프리셋 공유
유틸
pst0025
05/14 15650 43
(코이카츠) 프리셋 공유
유틸
pst0025
05/14 11369 58
comfyui를 이용해서 배경음을 식질해보자
유틸
프로베스트캣
05/14 20844 13