kone
sub_icon

심야시장

Base64 자동 디코더

2025-05-25 18:18:11
유틸
조회 4559 · 좋아요 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
탑 마을의 리즈 임신모드 플레이 중인데
질문&요청
rpffjrtldhqm12
05.27 250 0
[Ren'py] 에이전트17
번역
Covid-19
05.27 469 0
Peachbitch 25-26
질문&요청
hqwerasdf
05.26 485 2
형들 이거 어케 해결해??
질문&요청
anstkdqkffk1
05.26 633 0
[복구요청] 도나도나: 같이 나쁜 짓을 하자 복구요청드립니다
질문&요청
asxz75
05.25 777 1
(복구 알림글) RJ297120 마법소녀 셀레스포니아
번역
moeum
05.24 920 1
[복구요청] RJ297120 마법소녀 셀레스포니아 복구 요청 드려요
질문&요청
k8awd
05.24 409 0
[복구요청] 4K 꿈꾸는소녀 1~3화 + OVA
질문&요청
yurisia
05.24 884 0
(복구)[NumericGazer] 언더 더 위치 -비기닝 v1.8, 데보라 v0.3.2, 쿠로 v0.5.4- The Witch Gothic -Beginnings, Deborah's Room, Kuro's Room-
번역
moeum
05.22 4008 21
[요청] UTW_Beginnings 언더더위치 비기닝 / HerosJourney 한글번역판 요청 드립니다.
질문&요청
닉네임
05.21 1341 0
(복구)[いぬすく] RJ258445 RJ335930 여동생 생활 ~모노크롬~ v2.03 (손번역, 컬러, 흑백, Uncen) 妹!せいかつ ~モノクローム~
번역
moeum
05.21 1443 2
(복구 알림글) 러브 딜리버리 1,2 러브 인 로그인
번역
moeum
05.21 1513 4
Living With Sister: Monochrome Fantasy 한글 패치 파일 요청합니다!!
질문&요청
whitestar1206
05.21 654 0
[복구 요청] 러브딜리버리2 복구 요청
질문&요청
csh718
05.21 675 0
품번 알려주실 수 있으신가요?
질문&요청
cirius12
05.19 674 0
동인지 찾습니다
질문&요청
voyeur
05.18 628 0
잭 오 나인테일 apk 있나요
질문&요청
kokorogawakuwaku
05.18 742 0
[요청] 도스케베 후타나리 여학생 코코네의 오나사포 탐방
질문&요청
asdf0128
05.17 895 0
번역안된 동인지 다들 어케 봄?
질문&요청
갱생
05.16 822 0
peachbitch 작가 작품 있는 분 계신가요
질문&요청
ere03367
05.13 1343 7
검열 반대 청원글 (진짜 국민 개목줄 채울려고 안달났네)
일반
lamialove
05.13 1947 7
(복구)RJ221849 [ぴちぴち画廊R] 네토라레 음란 모성애를 주제로 한 건 ~사야카~
번역
moeum
05.12 2779 10
[복구요청] 네토라레 음모물건 사야카
질문&요청
pepeking
05.11 1059 2
[복구요청] 나는 지지 않아! ~사제로서의 30일~, 나도 지지 않아!
질문&요청
ba3019
05.10 1184 0
[복구요청] 죽어가는 그대, 관에서 싹트는 증오 번역판
질문&요청
asdaba1213q
05.09 1460 2
간염시리즈 누가 제대로 ai 번역됬으면 좋겠음
일반
hcs2352
05.09 885 -4
작가 이름좀 알려주실분
질문&요청
corvoatano
05.08 787 0
각 종 영상 90일
영상
호우우우
05.08 9106 -16
동인지 좀 찾아줘...
질문&요청
kosh1
05.08 762 0
[복구요청]언더 더 위치 쿠로 데보라
질문&요청
rmemwmqm
05.07 1199 0