この翻訳は不完全です。英語から この記事を翻訳 してください。

User-Agent リクエストヘッダーには、ネットワークプロトコルピアがアプリケーションタイプ、オペレーティングシステム、ソフトウェアベンダー、またはリクエストソフトウェア User Agent のソフトウェアバージョンを識別できるようにする特性文字列が含まれています。

Please read Browser detection using the user agent and why serving different Web pages or services to different browsers is usually a bad idea.

ヘッダータイプ Request header
Forbidden header name いいえ

構文

User-Agent: <product> / <product-version> <comment>

Common format for web browsers:

User-Agent: Mozilla/<version> (<system-information>) <platform> (<platform-details>) <extensions>

ディレクティブ

<product>
A product identifier
<product-version>
A version number of the product.
<comment>
Zero or more comments containing sub product information, for example.

Firefox の UA 文字列

For more details on Firefox and Gecko based user agent strings, see the Firefox user agent string reference. The UA string of Firefox itself is broken down into four components:

Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion

  • Mozilla/5.0 is the general token that says the browser is Mozilla compatible, and is common to almost every browser today.
  • platform describes the native platform the browser is running on (e.g. Windows, Mac, Linux or Android), and whether or not it's a mobile phone. Firefox OS phones simply say "Mobile"; the web is the platform. Note that platform can consist of multiple "; "-separated tokens. See below for further details and examples.
  • rv:geckoversion indicates the release version of Gecko (such as "17.0"). In recent browsers, geckoversion is the same as firefoxversion.
  • Gecko/geckotrail indicates that the browser is based on Gecko.
  • On Desktop, geckotrail is the fixed string "20100101"
  • Firefox/firefoxversion indicates the browser is Firefox, and provides the version (such as "17.0").

Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0

Chrome の UA 文字列

The Chrome (or Chromium/blink-based engines) user agent string is similar to the Firefox format. For compatibility, it adds strings like "KHTML, like Gecko" and "Safari".

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Opera の UA 文字列

The Opera browser is also based on the blink engine, which is why it almost looks the same, but adds "OPR/<version>".

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41

Safari の UA 文字列

In this example, the user agent string is mobile safari version. It contains the word "Mobile".

Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1

Internet Explorer の UA 文字列

Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)

クローラーと bot の UA 文字列

Googlebot/2.1 (+http://www.google.com/bot.html)

仕様

仕様書 タイトル
RFC 7231, セクション 5.5.3: User-Agent Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

ブラウザの互換性

Update compatibility data on GitHub
デスクトップモバイル
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewAndroid 版 ChromeEdge MobileAndroid 版 FirefoxAndroid 版 OperaiOS 版 SafariSamsung Internet
基本対応Chrome 完全対応 ありEdge 完全対応 ありFirefox 完全対応 ありIE 完全対応 ありOpera 完全対応 ありSafari 完全対応 ありWebView Android 完全対応 ありChrome Android 完全対応 ありEdge Mobile 完全対応 ありFirefox Android 完全対応 ありOpera Android 完全対応 ありSafari iOS 完全対応 ありSamsung Internet Android 完全対応 あり

凡例

完全対応  
完全対応

関連情報

ドキュメントのタグと貢献者

このページの貢献者: silverskyvicto
最終更新者: silverskyvicto,