PreloadScriptRegistration

external interface PreloadScriptRegistration(source)

Properties

Link copied to clipboard
abstract external var excludeGlobs: ReadonlyArray<String>?

Glob patterns for URLs the script will not run in.

Link copied to clipboard
abstract external var excludeMatches: ReadonlyArray<String>?

Match patterns for URLs the script will not run in.

Link copied to clipboard
abstract external var filePath: String

Path of the script file. Must be an absolute path.

Link copied to clipboard
abstract external var id: String?

Unique ID of preload script. Defaults to a random UUID.

Link copied to clipboard
abstract external var includeGlobs: ReadonlyArray<String>?

Glob patterns applied after matches. A URL must also match one of these globs. * matches any sequence of characters and ? matches zero or one character. Must not be empty.

Link copied to clipboard
abstract external var matches: ReadonlyArray<String>?

Match patterns for URLs the script runs in. A custom protocol can be used if its scheme is registered as standard with protocol.registerSchemesAsPrivileged. To filter documents served from a non-standard scheme, use includeGlobs or excludeGlobs, which match against the whole URL. If omitted, the script runs for all URLs not excluded by other filters. Must not be empty.

Link copied to clipboard
abstract external var matchOriginAsFallback: Boolean?

Whether a document whose URL has no origin of its own (about:, blob:, data: or filesystem:) is matched by the origin of the frame that created it instead of by its URL. This includes documents with an opaque origin, such as a data: frame or a sandboxed <iframe srcdoc>. For example, an about:blank popup opened by https://example.com/page is matched as https://example.com/. When set, every pattern in matches must have a path of &#47;*. Only applies to frame contexts. Default is false.

Link copied to clipboard
abstract external var type: PreloadScriptRegistrationType

Context type where the preload script will be executed. Possible values include frame or service-worker.