diff --git a/src/main/capabilities/web-batch2.ts b/src/main/capabilities/web-batch2.ts index db61113..b18624a 100644 --- a/src/main/capabilities/web-batch2.ts +++ b/src/main/capabilities/web-batch2.ts @@ -71,4 +71,16 @@ register(["Element_ElementAarray", "Element_ElementCaptureSimilar"], async (ctx, }); ctx.log("已获取 " + references.length + " 个相似元素(数组)", "info", node.id); return references; +});\n\nregister("Element_StartAutoClosePopup", async (ctx, node) => { + const browser = await browserSession(); + const started = browser.startAutoCloseDialogs(); + ctx.log(started ? "弹窗自动关闭已开启" : "弹窗自动关闭已在运行中", "info", node.id); + return { active: true, started }; +}); + +register("Element_StopAutoClosePopup", async (ctx, node) => { + const browser = await browserSession(); + const stopped = browser.stopAutoCloseDialogs(); + ctx.log(stopped ? "弹窗自动关闭已停止" : "弹窗自动关闭未在运行", "info", node.id); + return { active: false, stopped }; });