ectrol 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -299,7 +299,12 @@ var ElementHandle = class {
299
299
  * 检查元素是否存在(支持超时轮询)。
300
300
  */
301
301
  async exist(timeout) {
302
- return await this.contents.executeJavaScript(`!!${this._getElement(timeout)}`);
302
+ return await this.contents.executeJavaScript(`
303
+ (async () => {
304
+ const target = await ${this._getElement(timeout)};
305
+ return !!target;
306
+ })()
307
+ `);
303
308
  }
304
309
  /**
305
310
  * 获取元素的位置信息。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ectrol",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "description": "一个基于 Electron WebContents 的轻量级自动化助手,用于在你的应用内对网页内容进行交互(点击、输入、聚焦、键盘事件等)。",
6
6
  "author": "Cee Vee X <ceeveex@hotmail.com>",
7
7
  "license": "MIT",