kone
sub_icon

심야시장

Base64 자동 디코더

2025-05-25 18:18:11
유틸
조회 4569 · 좋아요 3

Tempermonkey 설치 후 아래 스크립트 추가 하기...


설명은 다른사람들이 알아서 할것 같아서 그냥 싸지르고 튀겠습니다.


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

// ==UserScript==

// @name         Base64 AutoDecoder

// @namespace    http://tampermonkey.net/

// @version      1.0

// @description  디코딩 가능한 base64 문자열을 링크로 변환합니다.

// @author       Zeliper

// @match        https://kone.gg/s/imya/*

// @include      https://kone.gg/

// @grant        unsafeWindow

// ==/UserScript==

unsafeWindow.on = true ;

( function () {

'use strict' ;

// Base64 문자열을 URL로 디코딩하는 함수

function  decodeBase64ToURL(str) {

try  {

const  decoded =  atob(str); // Base64 디코딩

// URL이 http 또는 https로 시작하는지 확인

if  ( / ^https?:\ / \ //.test(decoded)) {

return  decoded; // 유효한 URL이면 반환

            }

        } catch  (e) {

return null ; // 디코딩 오류가 나면 null 반환

        }

return null ;

    }

// 텍스트에서 Base64 문자열을 찾아 링크로 변환하는 함수

function  replaceBase64WithLink(node) {

console .log( "Node : " , node);

const  base64Regex = / \b[a - zA - Z0 - 9 + / = ]{ 20 ,}\b / g; // Base64 문자열을 찾는 정규식

let  text =  node.textContent; // 텍스트 노드의 텍스트 내용

let  match;

const parent =  node.parentNode;

let  lastIndex = 0 ;

// 텍스트에서 Base64 문자열을 찾아서 처리

while  ((match =  base64Regex.exec(text)) ! = = null ) {

const  before =  text.slice(lastIndex, match.index);

const  base64Str =  match[ 0 ];

const  decodedURL =  decodeBase64ToURL(base64Str);

if  (decodedURL) {

console .log(decodedURL);

// 유효한 URL이 디코딩되었으면 링크로 변환

const  a = document .createElement( 'a' );

                a.href =  decodedURL;

                a.textContent =  decodedURL;

                a.target = '_blank' ;

//node.textContent = ''; // <-- 나중에 문제 없으면 이거 넣어서 해도 될듯

                node.appendChild( document .createElement( 'br' ));

                node.appendChild(a);

            } else {

console .log( "Failed" );

            }

            lastIndex =  base64Regex.lastIndex;

        }

    }

// .prose-container의 Shadow DOM을 탐색하여 텍스트 변환

function  walkShadowRoot(shadowRoot) {

const  textNodes =  shadowRoot.querySelectorAll( ':not(div)' );

// 모든 텍스트 노드를 확인

        textNodes.forEach(node = >  {

            replaceBase64WithLink(node);

        });

    }

// .prose-container가 로드된 후 Shadow DOM 탐색

function  processShadowRoot() {

const  container = document .body.querySelector( '.prose-container' );

if  (container & &  container.shadowRoot) {

            walkShadowRoot(container.shadowRoot); // Shadow DOM 처리

        }

    }

// 페이지가 완전히 로드된 후 실행

function  onLoad() {

        processShadowRoot();

    }

// MutationObserver를 사용하여 .prose-container의 Shadow DOM 로드를 감지

const  observer = new  MutationObserver(() = >  {

const  container = document .body.querySelector( '.prose-container' );

if  (container & &  container.shadowRoot) {

            processShadowRoot();

        }

    });

// .prose-container가 추가될 때까지 대기

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

// 페이지 로딩이 완료되면 바로 실행

if  ( document .readyState = = = 'complete' ) {

        onLoad();

    }

})();

cs

3
댓글 6개
댓글 쓰기
25.05.25
복붙하니까 eslint : no-multi-spaces - multiple spaces found before 이런 오류 뜨는 데 왜 그런지 암?
주황색 세모에 ! 있는거 왼쪽 line표시에 나오는거면 eslint 문법 체크인데 무시해도됨. 실제 동작 하는지 페이지 새로고침 해서 base64문자 밑에 링크 생성만 되면 동작하고 있는거임
25.05.26 (04.02)

삭제된 댓글입니다.

25.05.27 (04.02)

삭제된 댓글입니다.

25.11.15
안되는데..
0 / 500
픽팍 냅둔 이유
공지
lili
25.10.29 28147 64
원하는 결과이긴 한데 과정이 아쉽네요
일반
ajahzvziw
25.10.29 6941 1
채널 규칙 변경 안내
공지
lili
25.10.29 7866 -8
나이의 조교일지
미번
ㅇㅇ
25.10.29 5268 -6
흐르는 별 팬디스크 요청
질문&요청
Ghost
25.10.29 1504 -1
밀착해서 귓속을 핥으면서 에치까지 해주는 테라피스트~
소리
Ghost
25.10.29 4326 -17
[복구] Bitch tok
영상
Ghost
25.10.29 10952 -20
[요청] 마왕과 돼지의 성
일반
think1
25.10.29 4050 -4
네토라세 카노조 ~마조 남친에게 보내는 NTR영상~
소리
Ghost
25.10.28 6046 -14
옷 갈아입히기 인형에 안 나오게 해줘 1
영상
Ghost
25.10.28 9353 -12
[복구요청]아이카기 1~3
일반
kikirinenes
25.10.28 2069 0
[복구] flim 모음
영상
Ghost
25.10.27 11939 -16
소프트하우스 캬라 작품 요청합니다
질문&요청
redwinw179
25.10.27 1145 -2
[복구] 첫 경험의 유부녀 1〜6화
영상
Ghost
25.10.27 6241 -12
혹시 옛날에 보이는여고생 야움짤 기억나는 사람?
질문&요청
newbi
25.10.27 1912 0
부실에서 들리는, 내가 모르는 천박한 메스 목소리~
소리
Ghost
25.10.26 2551 -8
한 10일쯤 전에 크로노 박스 받은사람 있나?
일반
jeson228
25.10.26 1586 1
[보이스코믹] 왜 내가 이딴 놈한테 못 이기는 거야
소리
마늘바가지
25.10.26 4146 -27
[보이스코믹] 참회구멍 1 ~ 3 노모자이크
소리
마늘바가지
25.10.26 4567 -28
peachbitch 작가 만화 있으신분
질문&요청
yuhwayuhwa
25.10.26 17629 3
[요청] 연기사 Purely☆Kiss
질문&요청
animeke
25.10.26 1426 -4
사무적 메이드에 의한 마조성 교육
소리
Ghost
25.10.26 2750 -5
복구가능하나요
질문&요청
Ghost
25.10.26 2636 -3
아〇나와 카〇의 봉사
영상
Ghost
25.10.26 5571 -10
이루루
영상
krzzizzi
25.10.26 3463 -10
[복구요청]RJ335930 여동생! 동거 생활 ~판타지~ 복구요청하는 레후~
질문&요청
dumbxjinping
25.10.26 1945 -2
[복구요청] [VJ01004376] 이챠 누나! ~누나로 연습해볼래?~ イチャ姉!
질문&요청
Kil
25.10.26 2289 -3
[복구요청]Miel작품 한패 몇개 복구요청합니다!
질문&요청
songsangsing
25.10.25 1875 3
에로게 시츄에이션
번역
neet
25.10.25 9130 31
UTW_Beginnings_Ver1_8 번역본
질문&요청
맬랑꼴리
25.10.25 1492 1