kone
소미소프트

소미소프트

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

05/27/2025, 07:00:13
유틸
3242 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
와우.. 능력자
⚠️⚠️멀웨어 탐지 스크립트 (신종 RAT) - 260502⚠️⚠️
유틸
moomin
05/02 17483 103
RPG Maker MV/MZ 실시간 번역기 3.1 (구동휘정3 대응 -3)
유틸
mrpls
04/30 17234 36
게임을 윈도우 샌드박스 안에서 실행하는 스크립트 (악성코드 대책)
유틸
mrpls
04/30 7331 19
[노모파일, AI] 파치몬 -8bit MONSTER-
유틸
soxocel777
04/29 20451 56
자동 소미 해적판의 해적판의 해적판 (260503 13:58 v1.3.5 업데이트)
유틸
bellbell
04/28 13550 38
[복구] 란스03 노모패치
유틸
imakotou
04/28 16055 28
MZ MV data 복호화 실행기
유틸
미요포
04/27 13671 38
제품 코드 추출기, 제품 코드 중복 찾기
유틸
ㅇㅇ
04/27 8566 18
MMD 모션,음악 통팩 공유
유틸
pst0025
04/26 9187 56
(코이카츠) 솔O티엘 작가 프리셋 통팩 공유
유틸
pst0025
04/25 12147 73
(코이카츠) 에러난 파일 복구 및 빠진거 보완
유틸
pst0025
04/25 10719 31
RPG MV/MZ 치트 플러그인 웹 딸깍 설치 오픈
유틸
mrpls
04/25 11374 28
RPG MV/MZ 안실시간 미리번역 업데이트
유틸
mrpls
04/23 7824 27
(코이카츠) - "큰거"
유틸
pst0025
04/22 16068 66
(코이카츠) 큰거 올리기 전에 작은거
유틸
pst0025
04/22 18970 62
(코이카츠) - 최신 프리셋 일부 공유 [v2]
유틸
pst0025
04/22 10928 45
마나카 모드들
유틸
kkkktrrr
04/22 17175 33
(코이카츠) - 최신 프리셋 일부 공유
유틸
pst0025
04/21 10780 48
RPG MV/MZ 실시간 번역기 딸깍 설치 웹사이트 오픈 (2.3 번역 주위 짤림)
유틸
mrpls
04/19 33325 106
(코이카츠) - グラフ 통팩 공유
유틸
pst0025
04/19 23176 56
RPG MV/MZ 실시간 번역기 1.10 (루나와 음욕의 함정 던전, 젬마4)
유틸
mrpls
04/18 24752 35
[노모패치, AI] 한 번만이라도 좋으니까, 나랑 해줘!
유틸
soxocel777
04/17 15270 29
( 코이카츠 ) - Anna anon 씬카드 공유
유틸
pst0025
04/16 24333 63
이미지 폴더 병합 & 일괄 이름 변경
유틸
noname
04/15 11564 30
RPG VX ace게임 전체화면으로 하는 꿀팁
유틸
야겜인생
04/14 11720 19
(코이카츠) Shibal 통팩
유틸
pst0025
04/14 19400 57
[노모패치] 부유마법도시의 레이 ~직계의 마도사~
유틸
데프픗
04/14 19635 28
[노모패치] Restore
유틸
데프픗
04/14 11713 21
[노모패치] 엘프 소녀 리피아와 몽환의 미궁
유틸
데프픗
04/14 18960 23
[90일] 용병의 모험 v3.001 노모 패치
유틸
ㅇㅇ
04/13 19102 47