Reddit Base64 Decoder

Userscript that automatically detects and decodes Base64 strings on Reddit, replacing them with readable content.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
rpmn0ise
今日安裝
2
安裝總數
4
評價
0 0 0
版本
1.0
建立日期
2026-04-18
更新日期
2026-04-18
尺寸
2.6 KB
授權條款
MIT
腳本執行於

Reddit Base64 Decoder

Userscript that automatically detects and decodes Base64 strings on Reddit, replacing them with readable content.


Features

  • Automatic detection of Base64 strings in posts and comments
  • Real-time decoding
  • Direct replacement of encoded text
  • Converts decoded URLs into clickable links
  • Handles dynamic content via MutationObserver

Example

Before:

aHR0cHM6Ly9tb2RzZmlyZS5jb20vOXRlOFc3NTRMdWs3Q0JU

After:

https://modsfire.com/9te8W754Luk7CBT

→ Automatically clickable


Installation

Just click the "Install this script" button.


How it works

  • Scans the DOM using TreeWalker
  • Detects Base64 strings via regex
  • Decodes using atob()
  • Replaces text with:

    • <a> element if it’s a URL
    • plain text otherwise
  • Observes DOM changes with MutationObserver


Technical Notes

  • Base64 detection regex:

```js id="ex3" /\b[A-Za-z0-9+/]{20,}={0,2}\b/g


* URL detection:

```js id="ex4"
/^https?:\/\/[^\s]+$/
  • UTF-8 handling:

```js id="ex5" decodeURIComponent(escape(atob(str)))


---

## Limitations

* Possible false positives (strings matching Base64 pattern)
* Decoded output may be unreadable (binary data)
* Depends on Reddit’s DOM structure
* May reprocess dynamically loaded nodes

---

## Improvements (TODO)

* Better false-positive filtering
* Optional UI (tooltip / toggle)
* Multi-site support
* Performance optimization (avoid redundant scans)
* Replace legacy UTF-8 handling with `TextDecoder`