【需要更新文档】engines.execScriptFile执行子脚本结束的API
- Autox.js 版本:634
- Autox.js 下载渠道:https://github.com/kkevsekk1/AutoX/releases
- Android 版本:Android 10
- Android 机型:小米MAX
- Android 系统类别:MIUI
- 问题描述:使用
let e = engines.execScriptFile("xx.js");执行脚本时,如果我们要检测该脚本是否执行结束,可以使用e.getEngine().isDestroyed()的方法来判断,但是文档中并没有isDestroyed()的API,建议更新文档
我也遇到了这个问题,但我是这样判断的
let scriptEngine;
function sleep (time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
function waitForEngineStart () {
return sleep(0x50).then(() => {
if (scriptEngine.engine) {
return scriptEngine.engine;
} else {
return waitForEngineStart();
}
});
}
function waitForEngineStop () {
return sleep(0x50).then(() => {
if (scriptEngine && scriptEngine.engine && !scriptEngine.engine.destroyed) {
return waitForEngineStop();
}
});
}
https://github.com/gucong3000/MiuiCleaner/blob/dev/src/miui_cleaner_app/serviceMgr.js
怎么把主线程的参数传给 engines.execScriptFile("xx.js") 运行的新脚本引擎里面,想要拿到新的脚本引擎,ScriptExecution.getEngine() 是在 脚本运行后才可以拿到
有相关api
发送自我的盖乐世
-------- 原始信息 -------- 发件人: Le-U @.> 日期: 2023/7/1 17:26 (GMT+08:00) 收件人: kkevsekk1/AutoX @.> 抄送: Subscribed @.***> 主题: Re: [kkevsekk1/AutoX] 【需要更新文档】engines.execScriptFile执行子脚本结束的API (Issue #441)
怎么把主线程的参数传给 engines.execScriptFile("xx.js") 运行的新脚本引擎里面,想要拿到新的脚本引擎,ScriptExecution.getEngine() 是在 脚本运行后才可以拿到
― Reply to this email directly, view it on GitHubhttps://github.com/kkevsekk1/AutoX/issues/441#issuecomment-1615777702, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD64RCHRUZV6UXVGZI3OEMTXN7UMDANCNFSM6AAAAAAQXLQKQY. You are receiving this because you are subscribed to this thread.Message ID: @.***>
此lssue由于长期未活动已被自动关闭,如问题任然存在,请重新打开lssue