Skip to main content
Version: 22.9.0

Target.asPage() 方法

¥Target.asPage() method

强制为任何类型的目标创建页面。如果你想将 other 类型的 CDP 目标作为页面处理,那么它会很有用。如果你处理常规页面目标,请使用 Target.page()

¥Forcefully creates a page for a target of any type. It is useful if you want to handle a CDP target of type other as a page. If you deal with a regular page target, use Target.page().

签名:

¥Signature:

class Target {
abstract asPage(): Promise<Page>;
}

Returns:

Promise<Page>