Frame.addScriptTag() 方法
¥Frame.addScriptTag() method
将 <script> 标记添加到具有所需 url 或内容的页面中。
¥Adds a <script> tag into the page with the desired url or content.
签名
¥Signature
class Frame {
addScriptTag(
options: FrameAddScriptTagOptions,
): Promise<ElementHandle<HTMLScriptElement>>;
}
参数
¥Parameters
范围 | 类型 | 描述 |
|---|---|---|
options | 脚本的选项。 |
Returns:
Promise<ElementHandle<HTMLScriptElement>>
元素句柄 到注入的 <script> 元素。
¥An element handle to the injected <script> element.