From b3d2bcb664d2c8fb8368ad517c7bc3cf0e43e523 Mon Sep 17 00:00:00 2001 From: cyfung1031 <44498510+cyfung1031@users.noreply.github.com> Date: Sun, 26 Apr 2026 20:26:40 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20VSCode=20=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E5=95=86=E5=BA=97=20=E8=B6=85=E8=BF=9E=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/use/6.vscode.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/use/6.vscode.md b/docs/use/6.vscode.md index 8cdf1072..4304b6f6 100644 --- a/docs/use/6.vscode.md +++ b/docs/use/6.vscode.md @@ -11,14 +11,14 @@ ScriptCat 提供了 VSCode 扩展,让你可以在 VSCode 中编写用户脚本 你需要安装以下两个工具: 1. **浏览器安装 ScriptCat 扩展** — 如果还没有安装,请参考 [快速开始](/docs/use/) 进行安装 -2. **VSCode 安装 ScriptCat 扩展** — 在 VSCode 扩展商店搜索「ScriptCat」,或前往 [GitHub 仓库](https://github.com/scriptscat/scriptcat-vscode) 下载安装 +2. **VSCode 安装 ScriptCat 扩展** — 在 VSCode 扩展商店搜索「[scriptcat-vscode](https://marketplace.visualstudio.com/items?itemName=CodFrm.scriptcat-vscode)」,或前往 [GitHub 仓库](https://github.com/scriptscat/scriptcat-vscode) 下载安装 ## 建立连接 安装完成后,需要让浏览器中的 ScriptCat 与 VSCode 建立连接: 1. 点击浏览器中的 ScriptCat 图标,打开管理面板 -2. 进入 **工具 > 开发调试** +2. 进入 **工具 > 开发工具** 3. 找到 **自动连接 VSCode 服务**,启用并点击 **连接** 连接成功后,VSCode 和 ScriptCat 之间就建立了实时通道。 @@ -56,7 +56,7 @@ ScriptCat 提供了 VSCode 扩展,让你可以在 VSCode 中编写用户脚本 - 确认浏览器中的 ScriptCat 扩展已启动 - 确认 VSCode 中的 ScriptCat 扩展已安装并启用 -- 检查 ScriptCat 管理面板中「开发调试」页面的连接状态 +- 检查 ScriptCat 管理面板中「开发工具」页面的连接状态 ### 保存后脚本没有更新? From 6fa5f40b1b7fd8bd5cf99eae5f1a25f7b237ae08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Mon, 6 Jul 2026 10:49:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs(use):=20=E8=A1=A5=E5=85=85=20VSCode=20?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=BC=80=E5=8F=91=E8=84=9A=E6=9C=AC=E7=9A=84?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../current/use/6.vscode.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/use/6.vscode.md diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use/6.vscode.md b/i18n/en/docusaurus-plugin-content-docs/current/use/6.vscode.md new file mode 100644 index 00000000..08885c6a --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/use/6.vscode.md @@ -0,0 +1,69 @@ +--- +title: Develop Scripts with the VSCode Extension +--- + +# Develop Scripts with VSCode + +ScriptCat provides a VSCode extension that lets you write user scripts in VSCode. After saving, changes are automatically synced to ScriptCat in the browser — no manual copy-pasting required, greatly improving development efficiency. + +## Prerequisites + +You need to install the following two tools: + +1. **Install the ScriptCat extension in your browser** — If you haven't installed it yet, follow the [Quick Start](/docs/use/) guide to install it +2. **Install the ScriptCat extension in VSCode** — Search for "[scriptcat-vscode](https://marketplace.visualstudio.com/items?itemName=CodFrm.scriptcat-vscode)" in the VSCode Extensions marketplace, or download it from the [GitHub repository](https://github.com/scriptscat/scriptcat-vscode) + +## Establish a Connection + +Once installed, you need to connect the ScriptCat extension in your browser with VSCode: + +1. Click the ScriptCat icon in your browser to open the management panel +2. Go to **Tools > Developer Tools** +3. Find **Auto-connect to VSCode service**, enable it, and click **Connect** + +Once connected, a real-time channel is established between VSCode and ScriptCat. + +## Sync Scripts + +After the connection is established, you can choose one of two ways to sync scripts: + +### Option 1: Auto-detect Mode (Recommended) + +1. In VSCode, press `Ctrl + Shift + P` (`Cmd + Shift + P` on Mac) to open the command palette +2. Type and select `scriptcat.autoTarget` +3. From then on, every time you open or save a `.user.js` file, it will be automatically synced to ScriptCat + +### Option 2: Specified Script Mode + +1. In VSCode, press `Ctrl + Shift + P` (`Cmd + Shift + P` on Mac) to open the command palette +2. Type and select `scriptcat.target` +3. Specify the path of the script file to sync + +## Development Workflow + +Once set up, the development workflow is very simple: + +1. Write or edit your `.user.js` script in VSCode +2. Press `Ctrl + S` to save the file +3. The script is automatically synced to ScriptCat in the browser +4. Switch to the browser and refresh the page to see the result + +The entire process requires no manual steps — saving takes effect immediately. + +## FAQ + +### What if it won't connect? + +- Make sure the ScriptCat extension in your browser is running +- Make sure the ScriptCat extension in VSCode is installed and enabled +- Check the connection status on the "Developer Tools" page in the ScriptCat management panel + +### The script isn't updated after saving? + +- Make sure the file name ends with `.user.js` +- Make sure you have run the `scriptcat.autoTarget` or `scriptcat.target` command +- Check the VSCode output panel for any error messages + +### Do I need to reconnect after restarting VSCode? + +If "Auto-connect to VSCode service" is enabled, VSCode will automatically reconnect after a restart — no manual steps required.