Rork Downloader

Intercepts Rork snapshot data and allows exporting code which stupidly is a premium feature of rork

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

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

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

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

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

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

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

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

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

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

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

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

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

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

作者
deeeeone
今日安裝
0
安裝總數
46
評價
0 0 0
版本
1.4
建立日期
2025-06-02
更新日期
2025-06-02
尺寸
6.0 KB
授權條款
未知
腳本執行於

📦 Rork Snapshot Downloader – Tampermonkey Userscript

This userscript allows you to download the full snapshot of a project from rork.com as a ZIP archive, preserving its original folder and file structure.

✨ Features

  • 🧠 Auto-detects project snapshot via DevTools Network API.
  • 📁 Reconstructs full directory tree from snapshot JSON.
  • 🗂 Zips everything into a downloadable archive.
  • 🔘 Adds a "Download Snapshot" button to the Rork UI header.
  • 💾 Caches the snapshot in IndexedDB so you can re-download without reloading the page.

🧩 Requirements

  • Tampermonkey installed on your browser (Chrome, Firefox, Edge, etc.)

🚀 Installation

  1. Install Tampermonkey if you haven't already.
  2. Click here to install the script or manually add the script from the file:
  • rork_snapshot_downloader.user.js
    1. Visit any Rork project, e.g.:
   https://rork.com/p/nidk8d3iupmlk6lmelulr

🛠️ How It Works

  1. When the page loads, it waits for the https://api.rork-direct.workers.dev/trpc/projects.fetchSnapshot network request.
  2. Once received, it extracts and parses the returned JSON snapshot.
  3. It constructs a complete virtual filesystem tree from the snapshot.
  4. When you click the "Download Snapshot" button in the header, it:
  • Builds a ZIP archive from the file tree.
  • Triggers the download with the appropriate file/folder structure.

📸 Example Output

project.zip
├── app/
│   └── index.tsx
├── assets/
├── app.json

🧹 Troubleshooting

  • If the snapshot hasn’t been received yet, the button will wait and retry once it's available.
  • Reload the page if the button doesn’t appear (Tampermonkey might need to re-inject the script).

🧪 Dev Notes

  • Uses JSZip to generate ZIP archive in-browser.
  • Runs at document-start for maximum reliability.
  • Works entirely client-side; no external dependencies required.

📄 License

MIT — Free to use, modify, and distribute.