[bug] 桌面分身内锄地一条龙 JS 脚本 htmlMask 调用失败 COMException 0x800700AA

Open
#3,883 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp, javascript
Domain
desktop, tooling

Research direction

The failure starts in the script's openHoeingHtmlConfigPanel call, which opens HtmlMaskWindow; the WebView2 error is thrown from HtmlMaskWindow.InitializeAsync at line 331 in the main BetterGI repository. Reproduce by running the script in BetterGI's desktop-clone mode with openHtmlConfig set to true, then compare with false. Done means the script logs a warning and continues when the panel cannot open, and the cause in the main app is either fixed or documented. The issue itself is still under discussion, so check with maintainers before starting.

Written by the indexing model from the issue text.

Description

提交确认
  • 我已搜索现有 Issue,确认没有相同问题
  • 我已阅读相关脚本的 README 或使用说明
  • 我已确认问题来自脚本或脚本仓库;BetterGI 本体问题应提交到主仓库
  • 我已移除日志、截图中的 UID、路径等隐私信息
涉及范围

JS 脚本

BetterGI 版本号

0.67.0

相关脚本名称与版本

锄地一条龙(AutoHoeingOneDragon)3.0.0

运行环境与关键配置

Windows 11 25H2 (26200)
运行方式:BetterGI「桌面分身」(子会话内运行,非主桌面)
openHtmlConfig:默认 true
executeMode:运行锄地路线 / 路径组一 / 配队「锄地」
分辨率 1920x1080,素材缩放 1.00

问题描述

现象:脚本启动后约 1 秒即结束,一条路线都不跑
在桌面分身内运行时,日志如下:

19:54:14.221 → 开始执行JS脚本: "锄地一条龙"
19:54:14.652 开始根据配置寻找路线组合 ← 面板预热(预览)阶段
19:54:15.197 [ERR] WebView2 初始化失败
System.Runtime.InteropServices.COMException (0x800700AA): 请求的资源在使用中。
at ...BetterGenshinImpact.View.HtmlMaskWindow.InitializeAsync() ...:line 331
19:54:15.229 → 脚本执行结束: "锄地一条龙", 耗时: 0分1.008秒

正常执行时应有的四条日志——开始加载模板图片 → 开始读取路径文件 → 预处理阶段完成 → 开始运行锄地路线——一条都没有出现。

issue-脚本仓库-锄地面板失败即退出.md

期望结果

建议把 HTML 配置面板改为可选且失败可降级,例如:
js
// 方案一:失败只警告,继续跑
if (!await openHoeingHtmlConfigPanel()) {
log.warn("HTML 配置面板打开失败,将使用当前配置继续运行");
}

// 方案二:区分"用户主动取消"与"环境不支持"
const panelResult = await openHoeingHtmlConfigPanel();
if (panelResult === "cancelled") return; // 用户点了取消 → 正常退出
if (panelResult === "failed") log.warn("面板不可用,使用当前配置继续");

理由:
面板的作用是让用户调整路线/分组,不改变脚本执行能力;面板不可用时用已有配置运行,是更合理的默认行为。
目前的行为是"因为看不到配置界面,所以什么都不做",对无人值守场景(一条龙连续执行多个配置组)尤其致命——后面所有配置组也会跟着受影响。

复现步骤

1、BetterGI 启用「桌面分身」,分身内 BGI 连接游戏;
2、在分身内运行 锄地一条龙 3.0.0,保持 openHtmlConfig 为默认 true;
3、脚本约 1 秒结束,日志出现 WebView2 初始化失败 / 0x800700AA;
4、把 openHtmlConfig 改为 false,仍在分身内运行 —— 脚本正常执行完整流程。
5、在 0.67.0 下可稳定复现(连续 4 次)

日志、截图或录屏

日志摘录-锄地htmlMask失败对照.log

其他信息

No response

Dominant language
JavaScript
Stars
793
Forks
505
Avg merge
1d 12h
Merged PRs (30d)
68

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from babalae/bettergi-scripts-list

All issues in babalae/bettergi-scripts-list

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.