---
title: mediaType
framework: webkit
role: symbol
role_heading: Instance Property
path: webkit/webpage/mediatype
---

# mediaType

The media type for the contents of the webpage.

## Declaration

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

## Discussion

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

- [WebPage.CSSMediaType](webkit/webpage/cssmediatype.md)
- [title](webkit/webpage/title.md)
- [url](webkit/webpage/url.md)
- [customUserAgent](webkit/webpage/customuseragent.md)
- [serverTrust](webkit/webpage/servertrust.md)
- [hasOnlySecureContent](webkit/webpage/hasonlysecurecontent.md)
- [themeColor](webkit/webpage/themecolor.md)
- [isBlockedByScreenTime](webkit/webpage/isblockedbyscreentime.md)
- [isInspectable](webkit/webpage/isinspectable.md)
- [isWritingToolsActive](webkit/webpage/iswritingtoolsactive.md)
