Contents

mediaType

The media type for the contents of the webpage.

Declaration

@MainActor final var mediaType: WebPage.CSSMediaType? { get set }

Discussion

When the value of this property is nil, the webpage derives the current media type from the CSS media property of its content. If you assign a value other than nil to this property, the webpage uses the value you provide instead.

For example, you can use this property to configure a page for viewing as a print preview by setting it to print.

The default value of this property is nil.

See Also

Inspecting page information