Frame.addStyleTag() 方法
🌐 Frame.addStyleTag() method
addStyleTag(): Promise<ElementHandle<HTMLStyleElement>>
将带有所需 URL 的 HTMLStyleElement 添加到框架中
🌐 Adds a HTMLStyleElement into the frame with the desired URL
语法
🌐 Signature
class Frame {
addStyleTag(
options: Omit<FrameAddStyleTagOptions, 'url'>,
): Promise<ElementHandle<HTMLStyleElement>>;
}
参数
🌐 Parameters
范围 🌐 Parameter | 类型 🌐 Type | 描述 🌐 Description |
|---|---|---|
options | Omit<FrameAddStyleTagOptions, 'url'> |
返回:
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
范围 🌐 Parameter | 类型 🌐 Type | 描述 🌐 Description |
|---|---|---|
options |
返回:
Promise<ElementHandle<HTMLLinkElement>>
对已加载 <link> 元素的 元素句柄。
🌐 An element handle to the loaded <link> element.