Puppeteer 中文文档v25.8.0

Touchscreen 类

Touchscreen 类公开了触摸屏事件。

签名

export declare abstract class Touchscreen

备注

此类的构造函数被标记为内部方法。第三方代码不应直接调用构造函数,也不应创建继承 Touchscreen 类的子类。

方法

方法

修饰符

说明

tap(x, y)

派发一个 touchstarttouchend 事件。

touchEnd()

在第一个活动的触摸上派发一个 touchend 事件。

touchMove(x, y)

在第一个活动的触摸上派发一个 touchMove 事件。

备注:

并非每次 touchMove 调用都会派发 touchmove 事件,这取决于浏览器的优化。例如,Chrome 会对 touch move 事件进行节流

touchStart(x, y)

派发一个 touchstart 事件。