RuleSet

@Serializable
data class RuleSet(val id: String, val loaderId: String, val sourceText: String, val backendNodeId: Int? = null, val url: String? = null, val requestId: String? = null, val errorType: Preload.RuleSetErrorType? = null, val errorMessage: String? = null)

Corresponds to SpeculationRuleSet

Constructors

Link copied to clipboard
constructor(id: String, loaderId: String, sourceText: String, backendNodeId: Int? = null, url: String? = null, requestId: String? = null, errorType: Preload.RuleSetErrorType? = null, errorMessage: String? = null)

Properties

Link copied to clipboard
val backendNodeId: Int? = null

A speculation rule set is either added through an inline <script> tag or through an external resource via the 'Speculation-Rules' HTTP header. For the first case, we include the BackendNodeId of the relevant <script> tag. For the second case, we include the external URL where the rule set was loaded from, and also RequestId if Network domain is enabled.

Link copied to clipboard
val errorMessage: String? = null

TODO(https://crbug.com/1425354): Replace this property with structured error.

Link copied to clipboard

Error information errorMessage is null iff errorType is null.

Link copied to clipboard
val id: String
Link copied to clipboard

Identifies a document which the rule set is associated with.

Link copied to clipboard
val requestId: String? = null
Link copied to clipboard

Source text of JSON representing the rule set. If it comes from <script> tag, it is the textContent of the node. Note that it is a JSON for valid case.

Link copied to clipboard
val url: String? = null