launch: auto port discovery; simphtml: init newTabs; SOP docs update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# ljqCtrl 使用与坐标转换 SOP
|
||||
|
||||
> **must call update_working_memory**:`ljqCtrl一律使用物理坐标|禁pyautogui|操作前先gw激活窗口`
|
||||
> **must call update working ckp**:`ljqCtrl一律使用物理坐标|禁pyautogui|操作前先gw激活窗口`
|
||||
|
||||
## 0. API 快速参考 (Signatures)
|
||||
- `ljqCtrl.dpi_scale`: float (缩放系数 = 逻辑宽度 / 物理宽度)
|
||||
|
||||
@@ -56,8 +56,12 @@ browser = "chrome" if shutil.which("chrome") else "msedge" # Edge内置必存
|
||||
### 方案A(自动化,优先)
|
||||
本地 HTTP 服务器 + TM 中间页,用 `start` 命令打开:
|
||||
1. Python 启动 `http.server` 托管脚本(Content-Type: text/javascript)
|
||||
- ⚠️ 必须用 `Popen(..., stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)` 丢弃输出
|
||||
- ❌ 禁用 `stdout=PIPE` 或 `stderr=PIPE`,会导致缓冲区满后服务器阻塞返回空响应
|
||||
- Windows 可加 `creationflags=subprocess.CREATE_NO_WINDOW` 避免弹窗
|
||||
2. `start "" "https://www.tampermonkey.net/script_installation.php#url=http://127.0.0.1:{port}/ljq_web_driver.user.js"`
|
||||
- ⚠️ 以上步骤均须用 `Popen` 非阻塞执行,禁止 `subprocess.run`,否则阻塞 agent
|
||||
- ⚠️ 以上步骤均须用 `Popen` 非阻塞执行,禁止 `subprocess.run`(会等待进程结束)
|
||||
- 服务器需持续运行直到用户完成安装,用 `Popen` 启动后立即返回继续执行
|
||||
3. TM 秒弹安装确认,用户点"安装"即可
|
||||
|
||||
### 方案B(手动 fallback)
|
||||
|
||||
Reference in New Issue
Block a user