|
| 1 | +# How to use the mhrv-rs Apps Script Helper (Chrome) |
| 2 | + |
| 3 | +[فارسی](HOW_TO_USE.fa.md) |
| 4 | + |
| 5 | +This guide is for **end users** who want the extension to help with Apps Script setup for [mhrv-rs](https://github.com/therealaleph/MasterHttpRelayVPN-RUST). You still deploy the script in **your** Google account and run **mhrv-rs** on your computer; the extension only prepares text and opens links. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 1. Install the extension (unpacked) |
| 10 | + |
| 11 | +1. Get the extension folder (the directory that contains `manifest.json`): |
| 12 | + - **Recommended:** clone [ardalan-ab/mhrv-helper-extension](https://github.com/ardalan-ab/mhrv-helper-extension) and use the **repo root**. |
| 13 | + |
| 14 | +2. Go to ( chrome://extensions/ ) |
| 15 | +3. Click on **Devloper mode** |
| 16 | +4. Click **Load unpacked** and select that folder. |
| 17 | +5. (Optional) Pin the extension from the puzzle icon so it stays in the toolbar. |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## 2. Open the popup and pick a language |
| 22 | + |
| 23 | +1. Click the extension icon. |
| 24 | +2. In the header, choose **English** or **فارسی**. Persian uses RTL layout. |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## 3. Download mhrv-rs (optional but useful) |
| 29 | + |
| 30 | +In **Step 0**: |
| 31 | + |
| 32 | +- Click **Download mhrv-rs** — Chrome opens the release asset the extension picks for your OS (from GitHub). |
| 33 | +- Or use **View all releases** if you want to choose another build (Android, musl, etc.). |
| 34 | + |
| 35 | +Unzip the archive and keep the folder somewhere you will run the app from (see the main project README). |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## 4. Generate the auth key |
| 40 | + |
| 41 | +In **Step 1**: |
| 42 | + |
| 43 | +1. Click **Generate auth key**. A 64-character hex string appears in the box. |
| 44 | +2. Click **Copy key** if you want it on the clipboard. |
| 45 | + |
| 46 | +Use this same value in two places: |
| 47 | + |
| 48 | +- Inside **Apps Script** as `AUTH_KEY` in `Code.gs` (the extension’s **Copy Code.gs** step will embed it for you when you copy). |
| 49 | +- In **mhrv-rs** as the auth key field when you save config. |
| 50 | + |
| 51 | +Treat it like a password. The extension generates it in the browser; it is not sent to a server by the extension. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## 5. Get Code.gs into Google Apps Script |
| 56 | + |
| 57 | +In **Step 2**: |
| 58 | + |
| 59 | +1. Wait until the spinner disappears and the script has loaded (from GitHub, or bundled fallback if GitHub is blocked). |
| 60 | +2. (Optional) Click **Check latest Code.gs** to see if the bundled copy matches the latest file on GitHub. |
| 61 | +3. Click **Open Apps Script** if you need a new project tab. |
| 62 | +4. In Apps Script: **New project** (or open an existing project), delete the default `Code.gs` content. |
| 63 | +5. Back in the extension, click **Copy Code.gs** (or **Download Code.gs** and open the file). |
| 64 | +6. Paste into the Apps Script editor and **Save**. |
| 65 | + |
| 66 | +Deploy as a **Web app** (see the main README Quick Start): **Execute as: Me**, **Who has access: Anyone** (unless your setup requires something else). Finish authorization if Google asks. |
| 67 | + |
| 68 | +Copy the **Deployment ID** Google shows you (you will paste it in Step 3 of the extension). |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## 6. Build your local config snippet |
| 73 | + |
| 74 | +In **Step 3**: |
| 75 | + |
| 76 | +1. Paste the **Deployment ID** into the **Deployment ID** field. |
| 77 | +2. Click **Copy config snippet**. |
| 78 | +3. Merge the JSON into your **`config.json`** for `mhrv-rs` (or paste into the app’s config UI if you use the graphical mode). |
| 79 | + |
| 80 | +Typical shape: |
| 81 | + |
| 82 | +```json |
| 83 | +{ |
| 84 | + "mode": "apps_script", |
| 85 | + "script_id": "YOUR_DEPLOYMENT_ID", |
| 86 | + "auth_key": "YOUR_AUTH_KEY", |
| 87 | + "listen_port": 8085 |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +The extension fills `script_id` and `auth_key` from what you entered and generated. |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +## 7. Run mhrv-rs and point the browser at the proxy |
| 96 | + |
| 97 | +Follow the **main project README** from “First run” onward: save config, start the proxy, set Firefox or Chrome to `127.0.0.1:8085` (or use SwitchyOmega as documented there). |
| 98 | + |
| 99 | +Use **View app docs** / **Open setup guide** in the extension footer for links to the official README and guide. |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## Troubleshooting (short) |
| 104 | + |
| 105 | +| Problem | What to try | |
| 106 | +|--------|-------------| |
| 107 | +| Script never loads | GitHub raw may be blocked; the extension falls back to bundled `Code.gs`. Use **Check latest Code.gs** after the network improves. | |
| 108 | +| Copy buttons do nothing | Some contexts block clipboard; try focusing the popup first or use **Download Code.gs** instead. | |
| 109 | +| Wrong binary downloaded | Use **View all releases** and pick the archive for your OS manually. | |
| 110 | + |
| 111 | +For deeper issues (CAPTCHA, Telegram, full tunnel), use [docs/guide.md](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/blob/main/docs/guide.md) in the main repo. |
0 commit comments