Security
✅️️ Methods
🔨Security.disable
禁用跟踪安全状态更改。
EN
Disables tracking security state changes.
🔨Security.enable
启用安全状态变化的追踪功能。
EN
Enables tracking security state changes.
🔨Security.setIgnoreCertificateErrors
启用/禁用是否忽略所有证书错误。
EN
Enable/disable whether all certificate errors should be ignored.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| ignore | ✔️ | boolean | 如果为真,将忽略所有证书错误。 | ENIf true, all certificate errors will be ignored. |
🔨Security.handleCertificateError❌️
处理触发了证书错误事件的证书错误。
EN
Handles a certificate error that fired a certificateError event.
| 参 数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| eventId | ✔️ | integer | 事件ID。 | ENThe ID of the event. | |
| action | ✔️ | CertificateErrorAction | 对证书错误采取的操作。 | ENThe action to take on the certificate error. |
🔨Security.setOverrideCertificateErrors❌️
启用/禁用覆盖证书错误。如果启用,所有证书错误事件都需要由 DevTools 客户端处理,并且应使用 handleCertificateError 命令进行响应。
EN
Enable/disable overriding certificate errors. If enabled, all certificate error events need to be handled by the DevTools client and should be answered with
handleCertificateError commands.| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| override | ✔️ | boolean | 如果为真,将忽略证书错误。 | ENIf true, certificate errors will be overridden. |
✅️️ Events
👋Security.certificateError❌️
存在证书错误。如果启用了覆盖证书错误功能,则应使用handleCertificateError命令进行处理。注意:若证书错误已在内部被允许,则不会触发此事件。每个目标同时只应有一个客户端覆盖证书错误。
EN
There is a certificate error. If overriding certificate errors is enabled, then it should be handled with the
handleCertificateError command. Note: this event does not fire if the certificate error has been allowed internally. Only one client per target should override certificate errors at the same time.| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| eventId | ✔️ | integer | 事件ID。 | ENThe ID of the event. | |
| errorType | ✔️ | string | 错误类型。 | ENThe type of the error. | |
| requestURL | ✔️ | string | 请求的URL。 | ENThe url that was requested. |
👋Security.securityStateChanged❌️
页面的安全状态已变更。不再发送。
EN
The security state of the page changed. No longer being sent.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| securityState | ✔️ | SecurityState | 安全状态。 | ENSecurity state. | |
| schemeIsCryptographic | ✔️ | ❌️ | boolean | 如果页面是通过加密传输(如HTTPS)加载的,则为真。 | ENTrue if the page was loaded over cryptographic transport such as HTTPS. |
| explanations | ✔️ | ❌️ | array[SecurityStateExplanation] | 之前是一个安全状态解释的列表。现在始终为空。 | ENPreviously a list of explanations for the security state. Now always empty. |
| insecureContentStatus | ✔️ | ❌️ | InsecureContentStatus | 页面不安全内容的相关信息。 | ENInformation about insecure content on the page. |
| summary | ❌️ | string | 覆盖用户可见的状态描述。始终省略。 | ENOverrides user-visible description of the state. Always omitted. |
👋Security.visibleSecurityStateChanged🧪
页面的安全状态已更改。
EN
The security state of the page changed.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| visibleSecurityState | ✔️ | VisibleSecurityState | 关于页面的安全状态信息。 | ENSecurity state information about the page. |
✅️️ Types
📌Security.CertificateErrorAction
当发生证书错误时采取的操作。continue 将继续处理请求,而 cancel 将取消请求。
允许的值:continue、cancel
EN
The action to take when a certificate error occurs. continue will continue processing the request and cancel will cancel the request.
Allowed Values:
Allowed Values:
continue, cancel返回类型:string
📌Security.CertificateId
一个内部证书ID值。
EN
An internal certificate ID value.
返回类型:integer
📌Security.MixedContentType
混合内容(HTTPS页面上的HTTP资源)的描述,定义参见https://www.w3.org/TR/mixed-content/#categories
允许取值:blockable, optionally-blockable, none
EN
A description of mixed content (HTTP resources on HTTPS pages), as defined by https://www.w3.org/TR/mixed-content/#categories
Allowed Values:
Allowed Values:
blockable, optionally-blockable, none返回类型:string
📌Security.SecurityState
页面或资源的安全等级。
允许的取值:unknown、neutral、insecure、secure、info、insecure-broken
EN
The security level of a page or resource.
Allowed Values:
Allowed Values:
unknown, neutral, insecure, secure, info, insecure-broken返回类型:string
📌Security.SecurityStateExplanation
对影响安全状态的一个因素的解释。
EN
An explanation of an factor contributing to the security state.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| securityState | ✔️ | SecurityState | 安全状态,表示所解释因素的严重程度。 | ENSecurity state representing the severity of the factor being explained. | |
| title | ✔️ | string | 描述因素类型的标题。 | ENTitle describing the type of factor. | |
| summary | ✔️ | string | 简短描述因素类型的短语。 | ENShort phrase describing the type of factor. | |
| description | ✔️ | string | 因素全文解释。 | ENFull text explanation of the factor. | |
| mixedContentType | ✔️ | MixedContentType | 解释所描述的混合内容类型。 | ENThe type of mixed content described by the explanation. | |
| certificate | ✔️ | array[string] | 页面证书。 | ENPage certificate. | |
| recommendations | array[string] | 修复任何问题的建议。 | ENRecommendations to fix any issues. |
📌Security.InsecureContentStatus❌️
页面不安全内容的相关信息。
EN
Information about insecure content on the page.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| ranMixedContent | ✔️ | boolean | 总是为假。 | ENAlways false. | |
| displayedMixedContent | ✔️ | boolean | 始终为假。 | ENAlways false. | |
| containedMixedForm | ✔️ | boolean | 总是为假。 | ENAlways false. | |
| ranContentWithCertErrors | ✔️ | boolean | 始终为假。 | ENAlways false. | |
| displayedContentWithCertErrors | ✔️ | boolean | 始终为假。 | ENAlways false. | |
| ranInsecureContentStyle | ✔️ | SecurityState | 始终设置为unknown。 | ENAlways set to unknown. | |
| displayedInsecureContentStyle | ✔️ | SecurityState | 始终设置为 unknown。 | ENAlways set to unknown. |
📌Security.CertificateSecurityState🧪
关于页面证书安全状态的详细信息。
EN
Details about the security state of the page certificate.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| protocol | ✔️ | string | 协议名称(例如 "TLS 1.2" 或 "QUIC")。 | ENProtocol name (e.g. "TLS 1.2" or "QUIC"). | |
| keyExchange | ✔️ | string | 连接所使用的密钥交换方式,如果不适用则为空字符串。 | ENKey Exchange used by the connection, or the empty string if not applicable. | |
| keyExchangeGroup | string | 连接所使用的(EC)DH群组,如适用。 | EN(EC)DH group used by the connection, if applicable. | ||
| cipher | ✔️ | string | 密码名称。 | ENCipher name. | |
| mac | string | TLS MAC。请注意,AEAD 密码没有单独的 MAC。 | ENTLS MAC. Note that AEAD ciphers do not have separate MACs. | ||
| certificate | ✔️ | array[string] | 页面证书。 | ENPage certificate. | |
| subjectName | ✔️ | string | 证书主题名称。 | ENCertificate subject name. | |
| issuer | ✔️ | string | 颁发证书的CA名称。 | ENName of the issuing CA. | |
| validFrom | ✔️ | Network.TimeSinceEpoch | 证书有效起始日期。 | ENCertificate valid from date. | |
| validTo | ✔️ | Network.TimeSinceEpoch | 证书有效期至(到期)日期 | ENCertificate valid to (expiration) date | |
| certificateNetworkError | string | 最高优先级的网络错误代码,如果证书存在错误。 | ENThe highest priority network error code, if the certificate has an error. | ||
| certificateHasWeakSignature | ✔️ | boolean | 如果证书使用了弱签名算法,则为真。 | ENTrue if the certificate uses a weak signature algorithm. | |
| certificateHasSha1Signature | ✔️ | boolean | 如果证书链中存在 SHA1 签名,则为真。 | ENTrue if the certificate has a SHA1 signature in the chain. | |
| modernSSL | ✔️ | boolean | 如果为现代 SSL | ENTrue if modern SSL | |
| obsoleteSslProtocol | ✔️ | boolean | 如果连接使用的是过时的SSL协议,则为真。 | ENTrue if the connection is using an obsolete SSL protocol. | |
| obsoleteSslKeyExchange | ✔️ | boolean | 如果连接使用的是过时的SSL密钥交换,则为真。 | ENTrue if the connection is using an obsolete SSL key exchange. | |
| obsoleteSslCipher | ✔️ | boolean | 如果连接使用的是过时的SSL密码,则为真。 | ENTrue if the connection is using an obsolete SSL cipher. | |
| obsoleteSslSignature | ✔️ | boolean | 如果连接使用的是过时的SSL签名,则为真。 | ENTrue if the connection is using an obsolete SSL signature. |
📌Security.SafetyTipInfo🧪
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| safetyTipStatus | ✔️ | SafetyTipStatus | 描述页面是否触发任何安全提示或信誉警告。默认值为未知。 | ENDescribes whether the page triggers any safety tips or reputation warnings. Default is unknown. | |
| safeUrl | string | 安全提示建议的URL("您是否意指?")。仅针对相似匹配项填写。 | ENThe URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches. |
📌Security.SafetyTipStatus🧪
允许的值:badReputation、lookalike
EN
Allowed Values:
badReputation, lookalike返回类型:string
📌Security.VisibleSecurityState🧪
关于页面的安全状态信息。
EN
Security state information about the page.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| securityState | ✔️ | SecurityState | 页面的安全级别。 | ENThe security level of the page. | |
| certificateSecurityState | CertificateSecurityState | 页面证书的安全状态详情。 | ENSecurity state details about the page certificate. | ||
| safetyTipInfo | SafetyTipInfo | 页面触发的安全提示类型。请注意,即使安全提示界面并未实际显示,此字段也会被设置。 | ENThe type of Safety Tip triggered on the page. Note that this field will be set even if the Safety Tip UI was not actually shown. | ||
| securityStateIssueIds | ✔️ | array[string] | 安全状态问题ID的数组。 | ENArray of security state issues ids. |