Skip to main content
Version: 23.2.0

Frame.addStyleTag() 方法

¥Frame.addStyleTag() method

addStyleTag():Promise<ElementHandle<HTMLStyleElement>>

HTMLStyleElement 添加到具有所需 URL 的框架中

¥Adds a HTMLStyleElement into the frame with the desired URL

签名

¥Signature

class Frame {
addStyleTag(
options: Omit<FrameAddStyleTagOptions, 'url'>
): Promise<ElementHandle<HTMLStyleElement>>;
}

参数

¥Parameters

范围

类型

描述

options

省略<FrameAddStyleTagOptions,'url'>

Returns:

Promise<ElementHandle<HTMLStyleElement>>

元素句柄 到加载的 <style> 元素。

¥An element handle to the loaded <style> element.

addStyleTag():Promise<ElementHandle<HTMLLinkElement>>

HTMLLinkElement 添加到具有所需 URL 的框架中

¥Adds a HTMLLinkElement into the frame with the desired URL

签名

¥Signature

class Frame {
addStyleTag(
options: FrameAddStyleTagOptions
): Promise<ElementHandle<HTMLLinkElement>>;
}

参数

¥Parameters

范围

类型

描述

options

FrameAddStyleTagOptions

Returns:

Promise<ElementHandle<HTMLLinkElement>>

元素句柄 到加载的 <link> 元素。

¥An element handle to the loaded <link> element.