Preload

class Preload(cdp: CDP) : Domain

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard

TODO(https://crbug.com/1384419): revisit the list of PrefetchStatus and filter out the ones that aren't necessary to the developers.

Link copied to clipboard
@Serializable
data class PrefetchStatusUpdatedParameter(val key: Preload.PreloadingAttemptKey, val pipelineId: String, val initiatingFrameId: String, val prefetchUrl: String, val status: Preload.PreloadingStatus, val prefetchStatus: Preload.PrefetchStatus, val requestId: String)

Fired when a prefetch attempt is updated.

Link copied to clipboard
@Serializable
data class PreloadEnabledStateUpdatedParameter(val disabledByPreference: Boolean, val disabledByDataSaver: Boolean, val disabledByBatterySaver: Boolean, val disabledByHoldbackPrefetchSpeculationRules: Boolean, val disabledByHoldbackPrerenderSpeculationRules: Boolean)

Fired when a preload enabled state is updated.

Link copied to clipboard
@Serializable
data class PreloadingAttemptKey(val loaderId: String, val action: Preload.SpeculationAction, val url: String, val targetHint: Preload.SpeculationTargetHint? = null)

A key that identifies a preloading attempt.

Link copied to clipboard
@Serializable
data class PreloadingAttemptSource(val key: Preload.PreloadingAttemptKey, val ruleSetIds: List<String>, val nodeIds: List<Int>)

Lists sources for a preloading attempt, specifically the ids of rule sets that had a speculation rule that triggered the attempt, and the BackendNodeIds of or elements that triggered the attempt (in the case of attempts triggered by a document rule). It is possible for multiple rule sets and links to trigger a single attempt.

Link copied to clipboard
@Serializable
data class PreloadingAttemptSourcesUpdatedParameter(val loaderId: String, val preloadingAttemptSources: List<Preload.PreloadingAttemptSource>)

Send a list of sources for all preloading attempts in a document.

Link copied to clipboard

Preloading status values, see also PreloadingTriggeringOutcome. This status is shared by prefetchStatusUpdated and prerenderStatusUpdated.

Link copied to clipboard

List of FinalStatus reasons for Prerender2.

Link copied to clipboard
@Serializable
data class PrerenderMismatchedHeaders(val headerName: String, val initialValue: String? = null, val activationValue: String? = null)

Information of headers to be displayed when the header mismatch occurred.

Link copied to clipboard
@Serializable
data class PrerenderStatusUpdatedParameter(val key: Preload.PreloadingAttemptKey, val pipelineId: String, val status: Preload.PreloadingStatus, val prerenderStatus: Preload.PrerenderFinalStatus? = null, val disallowedMojoInterface: String? = null, val mismatchedHeaders: List<Preload.PrerenderMismatchedHeaders>? = null)

Fired when a prerender attempt is updated.

Link copied to clipboard
@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

Link copied to clipboard
Link copied to clipboard
@Serializable
data class RuleSetRemovedParameter(val id: String)
Link copied to clipboard
@Serializable
data class RuleSetUpdatedParameter(val ruleSet: Preload.RuleSet)

Upsert. Currently, it is only emitted when a rule set added.

Link copied to clipboard

The type of preloading attempted. It corresponds to mojom::SpeculationAction (although PrefetchWithSubresources is omitted as it isn't being used by clients).

Link copied to clipboard

Corresponds to mojom::SpeculationTargetHint. See https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints

Properties

Link copied to clipboard

Fired when a prefetch attempt is updated.

Link copied to clipboard

Fired when a preload enabled state is updated.

Link copied to clipboard

Send a list of sources for all preloading attempts in a document.

Link copied to clipboard

Fired when a prerender attempt is updated.

Link copied to clipboard
Link copied to clipboard

Upsert. Currently, it is only emitted when a rule set added.

Functions

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)
Link copied to clipboard
suspend fun enable(mode: CommandMode = CommandMode.DEFAULT)