Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DeepFetchHtmlConfig

Hierarchy

Index

Properties

as

as: "image" | "script" | "style" | "font" | "fetch" | "video"

The value for the <link rel="prefetch|preload"> element's as attribute. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link. Use "fetch" for html pages as Safari doesn't support "document".

attribute

attribute: string

The attribute whose value should be prefetched. Defaults to src.

Optional callback

callback: undefined | ((param: DeepFetchCallbackParam) => void)

A callback to override the default prefetching logic. Will be called for each matching element, or if maxMatches is provided, the first n elements.

Optional cors

cors: false | "anonymous" | "use-credentials"

The value of the crossorigin attribute of the prefetch link. Defaults to 'anonymous'. Setting this to false makes it so the crossorigin attribute is omitted, i.e. no CORS is used.

Optional maxMatches

maxMatches: undefined | number

The max number of matching elements to prefetch per page

selector

selector: string

The CSS selector to use when finding elements whose src or href should be deep fetched

Generated using TypeDoc