Skip to main content
Version: 23.2.0

Frame.name() 方法

¥Frame.name() method

警告:此 API 现已过时。

¥Warning: This API is now obsolete.

使用

¥Use

const element = await frame.frameElement();
const nameOrId = await element.evaluate(frame => frame.name ?? frame.id);

标签中指定的框架的 name 属性。

¥The frame's name attribute as specified in the tag.

签名

¥Signature

class Frame {
name(): string;
}

Returns:

string

备注

¥Remarks

该值在框架创建时计算一次,如果以后属性更改,该值将不会更新。

¥This value is calculated once when the frame is created, and will not update if the attribute is changed later.