kone
심야시장

심야시장

Base64 자동 디코더

05/25/2025, 18:18:11
유틸
4582 views · 3 likes

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 comments
Sign in to comment
05/25/25
복붙하니까 eslint : no-multi-spaces - multiple spaces found before 이런 오류 뜨는 데 왜 그런지 암?
주황색 세모에 ! 있는거 왼쪽 line표시에 나오는거면 eslint 문법 체크인데 무시해도됨. 실제 동작 하는지 페이지 새로고침 해서 base64문자 밑에 링크 생성만 되면 동작하고 있는거임
05/26/25 Edited 04/02

Deleted comment.

05/27/25 Edited 04/02

Deleted comment.

11/15/25
안되는데..
Sign in to comment
[복구요청]리얼 에로게 시츄에이션!2
질문&요청
songsangsing
10/25/25 1248 0
[복구요청]Daily Lives of My Countryside-v0.3. 미번
질문&요청
hxxu12
10/25/25 1152 0
[복구 요청] RJ343891 후타나리 연금술사 트리스는 섹스하고 싶어! Ver 2.00 요청드립니다!
질문&요청
bananana
10/25/25 1671 1
거유 판타지1 복구 부탁드립니다
질문&요청
kjs322
10/25/25 1444 1
요청) 상태를 타고있는 레이어로 오타사의 공주를 교사의 내가 속이고 하메 찍어 보았다
질문&요청
luna124
10/25/25 1141 0
얼굴 없는 달 -달맞이의 쌍동백- (수정패치 추가)
번역
forgetmenot
10/24/25 9331 34
자위 방송 중에 갑자기 분수 폭발
소리
Ghost
10/24/25 4819 -7
[Poison] [Posion Motion] [POISON EXTASY] 비쥬얼 노벨 15종
번역
Ghost
10/24/25 25095 31
신님 츄~즈! 선생님 여자아이 잘 어울려요! 복구 요청해요
질문&요청
헤츠링
10/24/25 1256 0
[복구] 4K 꿈꾸는소녀 1~3화 + OVA
영상
Ghost
10/24/25 5112 -13
카린 모드 하는데 컷신이 자꾸 겹쳐져서 안보임
질문&요청
1-q2w3e4-r
10/24/25 1241 0
[복구요청] POISON 4개
질문&요청
QIL
10/24/25 2104 2
Jelly 모음
영상
Ghost
10/24/25 5508 -2
pikpak 유료버전을 써야지만 파일 언락 가능한가요?
질문&요청
twinpress
10/24/25 7233 0
JK 퇴마부 1~3
소리
Ghost
10/23/25 5368 -11
[요청] 통심보 ~엄마한텐 비밀인 시간표~
질문&요청
벽지뜯는고양이
10/23/25 2386 0
[복구요청] 교간의 프로들
질문&요청
parallel
10/23/25 1054 0
Pitstop Queen - Overtime
영상
Ghost
10/23/25 3537 -10
[복구요청] DEAD DAYS 부탁드립니다
질문&요청
pierrot1004
10/23/25 1259 2
[복구요청] [FG Remake] 야근병동 리메이크
질문&요청
twinpress
10/23/25 1590 1
[복구요청] 오크 소프트(orcsoft) 아내는 오늘밤도 빼앗긴다~남편이 모르는 청초계 거유처의 과거와 현재~
질문&요청
Karryn
10/23/25 1787 1
[복구요청]Love x Holic 요청합니다
질문&요청
wawawave162
10/23/25 1657 2
[복구요청] 공주기사의 개천박한 패배 인생
질문&요청
QIL
10/23/25 2085 3
방과후 신데렐라 1. 2 fd요청드려요
질문&요청
후크선장
10/23/25 930 1
[복구요청]소프랜드의 팔척귀신님
질문&요청
songsangsing
10/22/25 1585 3
새벽을 기다리는 별들에게
번역
ㅇㅇ
10/22/25 11422 20
이웃에게 시리즈
번역
ㅇㅇ
10/22/25 10822 21
소악마 리사
번역
ㅇㅇ
10/22/25 8180 15
[즉시 타락 X 천박 신음] 자기애 강한 츤데레
소리
Ghost
10/22/25 2984 -6
리OO 다람쥐 임무 실패! 1,2
영상
Ghost
10/22/25 2411 -2