Document: contentType プロパティ

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Document.contentType プロパティは読み取り専用で、文書がレンダリングされる MIME タイプを返します。これは HTTP ヘッダーやその他の MIME 情報のソースから来る可能性があり、ブラウザーや拡張機能によって行われる自動型変換の影響を受ける可能性があります。

メモ: このプロパティは <meta> 要素には影響されません。

contentType は読み取り専用のプロパティです。

仕様書

Specification
DOM
# ref-for-dom-document-contenttype①

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
contentType

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Has more compatibility info.