Skip to main content
Version: 24.38.0

FrameWaitForFunctionOptions 接口

🌐 FrameWaitForFunctionOptions interface

语法

🌐 Signature

export interface FrameWaitForFunctionOptions

属性

🌐 Properties

属性

🌐 Property

修饰符

🌐 Modifiers

类型

🌐 Type

描述

🌐 Description

默认

🌐 Default

polling

optional

'raf' | 'mutation' | number

执行 pageFunction 的间隔,默认值为 raf。如果 polling 是一个数字,则将其视为函数执行的毫秒间隔。如果 polling 是一个字符串,则可以是以下值之一:

🌐 An interval at which the pageFunction is executed, defaults to raf. If polling is a number, then it is treated as an interval in milliseconds at which the function would be executed. If polling is a string, then it can be one of the following values:

  • raf - 在 requestAnimationFrame 回调中持续执行 pageFunction。这是最紧密的轮询模式,适合观察样式变化。
  • mutation - 在每次 DOM 变更时执行 pageFunction
signal

optional

AbortSignal

允许你取消 waitForFunction 调用的信号对象。

🌐 A signal object that allows you to cancel a waitForFunction call.

timeout

optional

number

等待的最长时间,以毫秒为单位。默认值为 30000(30 秒)。传入 0 可禁用超时。Puppeteer 的默认超时可以使用 Page.setDefaultTimeout() 修改。

🌐 Maximum time to wait in milliseconds. Defaults to 30000 (30 seconds). Pass 0 to disable the timeout. Puppeteer's default timeout can be changed using Page.setDefaultTimeout().