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.
- package/dist/index.mjs +6 -1
- 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(
|
|
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