[59] [[HTTP]]、[[電子メール]]、[[ネットニュース]]、[[RTSP]]、[[SIP]] その他の[[プロトコル]]で使われている
[DFN[[CODE(HTTP)[User-Agent:]] 欄]]は、
使用されている[[利用者エージェント]]を表します。

[NOTE[
[61] '''誘導''':
[Q[利用者エージェント]]一般については
[Q[[[利用者エージェント]]]]および [Q[[[User Agent]]]]
をご覧下さい。
[[CGI]] での利用に関しては [Q[[CODE(CGI)[[[HTTP_USER_AGENT]]]]]]
の項をご覧下さい。 [[HTTP]] その他に関してはここをご覧下さい。
その他関連プロトコル要素に関しては >>62 をご覧下さい。
]NOTE]

* 仕様書

[REFS[
- [83] '''[CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-5.5.3>'''
- [29] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-08-07 05:54:02 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-9.6>
- [32] [CITE[UPnP Device Architecture 2.0]] ([TIME[2014-09-05 02:24:48 +09:00]] 版) <http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v2.0.pdf#page=38>
- [37] [CITE[UPnP Device Architecture 2.0]] ([TIME[2014-09-05 02:24:48 +09:00]] 版) <http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v2.0.pdf#page=47>
]REFS]

* 意味

[84] [CODE(HTTP)@en[[[User-Agent:]]]] は、[[要求]]を元々作成した[[利用者エージェント]]についての情報を含めるものです。
これはしばしば[[鯖]]が[[相互運用性]]の問題を究明する補助となったり、
特定の[[利用者エージェント]]の制限を回避したり、
利用されている[[ブラウザー]]や[[OS]]の分析に使ったりするものです。 [SRC[>>83]]

;; [[利用者エージェントの識別]]も参照。

* 構文

[86] 1つ以上の [CODE(ABNF)@en[[[product]]]] または [CODE(ABNF)@en[[[comment]]]]
を、 [[RWS]] 区切りで並べたものとされています。ただし、最初の1つは
[CODE(ABNF)@en[[[product]]]] でなければなりません。 [SRC[>>83]]

[FIG(railroad)[
= [CODE(ABNF)@en[[[product]]]]
= *
== [[RWS]]
== |
=== [CODE(ABNF)@en[[[product]]]]
=== [CODE(ABNF)@en[[[comment]]]]
]FIG]

[88] ここで [CODE(ABNF)@en[[[product]]]] は、[[利用者エージェント]]のソフトウェアと主要な部分製品を識別上の重要なものから順番に並べたもの
[SRC[>>83]] とされています。

[87] 現実にはこの構文は、ヒント程度にしか尊重されていません。 [[HTTP]]
仕様上の[[字句]]では認められていない文字列が使われることもありますし、
[CODE(ABNF)@en[[[product]]]] に複数 [CODE[[[/]]]] が含まれることもあります。
順序も必ずしも重要な順ではありません。実際のソフトウェアの識別に関与しない歴史的な値を設定することも多々あります。

[89] [[送信者]]は、[[生成]]する値を製品の識別に必要な程度に制限する[['''べきです''']]。
[[広告]]その他製品の識別に必要無い情報を[[生成]]しては[['''なりません''']]。
第三者による部分製品からの追加も制限する[['''べきです''']]。 [SRC[>>83]]

[90] 版番号の部分に版情報でないものを含める[['''べきではありません''']]
(つまり、同じ製品の後の版は版番号部分だけが違うべきです)。 [SRC[>>83]]

[92] 他の実装との互換性を示すためにその製品名を含めることは[RUBYB[推奨]@en[encourage]]しません
[SRC[>>83]]。

[33] [[SSDP]] [SRC[>>32]] や [[UPnP]] [SRC[>>37]] における [[HTTP]] ではより細かく構文が決められています。

** ローカルルール

[68] [CITE[Discord Developer Portal — Documentation — Reference]], [TIME[2023-05-31T22:18:22.000Z]], [TIME[2023-06-01T05:36:42.178Z]] <https://discord.com/developers/docs/reference#user-agent>

>
[PRE(HTTP code)[
User-Agent: DiscordBot ($url, $versionNumber)
]PRE]
>
Clients may append more information and metadata to the end of this string as they wish.


* 文脈

[85] [[利用者エージェント]]は、特に設定がない限り、各[[要求]]に
[CODE(HTTP)@en[[[User-Agent:]]]] を含める[['''べきです''']] [SRC[>>83]]。

[103] [[サーバー]]によっては、 [CODE(HTTP)@en[[[User-Agent:]]]] がなかったり、
空だったりすると[[要求]]を拒絶することがあるようです。 [[Web互換性]]のためには
[CODE(HTTP)@en[[[User-Agent:]]]] [[ヘッダー]]を要求に含める必要があります。

* 処理

[19] [[利用者エージェントの識別]]を参照。

* セキュリティー

[20] [[利用者エージェントの識別]]を参照。

* プライバシー

[91] [CODE(HTTP)@en[[[User-Agent:]]]] の値は [[fingerprinting]]
に使われることがあり [SRC[>>83]]、注意が必要です。

[21] [[利用者エージェントの識別]]を参照。

* 歴史

[FIG(quote)[
[FIGCAPTION[
[82] RFC 1945 (HTTP/1.0) 10.15; RFC 2068 (HTTP/1.1) 14.42; RFC 2616 (HTTP/1.1) 14.43 User-Agent
]FIGCAPTION]

> The User-Agent request-header field contains information about the
user agent originating the request. This is for statistical purposes,
the tracing of protocol violations, and automated recognition of user
agents for the sake of tailoring responses to avoid particular user
agent limitations. [DEL[Although it is not required, user agents should]] [INS[User agents SHOULD]]
include this field with requests. The field can contain multiple product tokens
(Section [DEL[3.7]] [INS[3.8]]) and comments identifying the agent and any subproducts which
form a significant part of the user agent. By convention, the product tokens
are listed in order of their significance for identifying the application.

[DFN[[CODE(HTTP)[User-Agent]] [[要求頭欄]]]]は、要求を作成した[[利用者エージェント]]についての情報を含みます。
これは、統計目的、プロトコル違反の追跡、および特定利用者エージェントの制限を避けるために応答を手直しするための利用者エージェントの自動認識のためのものです。
利用者エージェントは、この欄を要求に含める'''べきです'''。
この欄は、複数の [CODE(ABNF)[[[product]]]] 字句ならびに利用者エージェントおよび利用者エージェントの重要な部分を形成する部分製品を識別する注釈を含めることができます。
慣習的に、 [CODE(ABNF)[product]] 字句は、その応用を識別するのに有意な順に列挙します。

>
- User-Agent     = "User-Agent" ":" 1*( product | comment )

> Example:
- User-Agent: CERN-LineMode/2.15 libwww/2.17b3

[DEL[

> Note: Some current proxy applications append their product
information to the list in the User-Agent field. This is not
recommended, since it makes machine interpretation of these
fields ambiguous.

注意: 既存の[[串]]応用の中には [CODE(HTTP)[User-Agent]] 欄の並びに自身の製品情報を付加するものもあります。
これは、この欄の機械的解釈が曖昧になってしまうので、推奨しません。

> Note: Some existing clients fail to restrict themselves to
the product token syntax within the User-Agent field.

注意: 既存のクライアントの中には [CODE(HTTP)[User-Agent]] 欄の product 字句構文に反しているものもあります。
]DEL]

[INS[

注: 修正部はすべて RFC 1945→RFC 2068 での変更点。
]INS]
]FIG]

** USEFOR draft (電子ニュース・メッセージ) での規定に関して

[44] product の中身が [[HTTP]] では [[token]] でしたが、 usefor
では [[value]] になりました。このおかげで、漢字を使った名前とかも入れられます。

- [45] User-Agent-content   = product-token *( CFWS product-token )
- [46] User-Agent-header    = "User-Agent" ":" SP User-Agent-content *( ";" other-parameter )
- [47] product-token        = value [ "/" product-version ]
- [48] product-version      = value

- [17] [[ietf-usefor]] の議論をちょっと目を離した隙に、 [CODE(ABNF)[product]] が [CODE(ABNF)[token]] に変わってしまいました。 ([[HTTP]] と同じになった。) だから [SAMP["A User Agent"]] も [SAMP["なんかの利用者エージェント"]] も駄目になりました。 (なんでそうなったのかは、議論を追えてないので分かりませぬ。)
- [18] ''17'': [[電子ニュース]]記事の[[国際化]]を目指した [[usefor-article]] にとって大きな後退です。たとえこのままの仕様で [[RFC]] になってしまっても、 [[UTF-8]] が使える''旧仕様のメッセージを流し続けましょう''。そうすれば son-of-usefor でちゃんとなるかもしれん。
- [26] [WEAK[2002-12-22 21:46]] ''>>10'': [[comment]] の中なら [[encoded-word]] でも OK ですね。
- [27] [CODE(ABNF)[product-version]] に [[quoted-string]] を使った例: [CODE[User-Agent: FooNews/"1.0(Beta1)"]]
- [28] [CODE(ABNF)[encoded-word]] を [CODE(ABNF)[comment]] 中に使った例: [CODE[User-Agent: "Bar@"/1.2 (=?us-ascii?q?Micro=24oft_Windoze_XP?= ; i686)]]
- [31] [WEAK[2002-12-25 18:08]] ''>>17'': まだ関係する記事を全部読んでないんですが、どうも電子メイルに gatewaying する時に [CODE(ABNF)[product]] の部分が UTF-8 だったらどうするのかが問題になって、 [[encoded-word]] にするのは鬱だし、いっそのことやめちまえになったっぽいです。'''ま た e n c o d e d - w o r d か !'''

** Client-Specific Web Services by Using User Agent Attributes 

[40] UA: にクライアント情報を一杯詰め込んじまおうという
'''Client-Specific Web Services by Using User Agent Attributes''' <http://www.w3.org/TR/NOTE-agent-attributes> W3C NOTE 12-30-1997。
仕様考えた会社位しか実装例が無いらしい(w)。

- [41] User-Agent: AVE-Front/2.0 (BrowserInfo Screen=640x480x256; InputMethod=REMOCON,KEYBOARD; Page=512K; Product=XXXX/Internet-TV; HTML-Level=3.2; Language=ja.JIS; Category=TV; CPU=SH2; Storage=NO;) 

[42] 一応 [[BNF]] とかでちゃんと定義してある。

= Prop_def = "(" "BrowserInfo" Prop_items ")"
= Prop_items = Prop_item | Prop_items Prop_item 
= Prop_item = Prop_name "=" Prop_value ";"
= Prop_name = STRING
= Prop_value = STRING 

> The upper case and lower case in describing Prop_name and Prop_value 
> have to be discriminated. 

= Prop_name  = "Screen" | "InputMethod" | "Page" | "Product" | "HTML-Level" | "Language" | "Category" | "CPU" | "Storage"  

"Screen", "InputMethod", "Page", "Product", "HTML-Level" は強く推奨らしいぞ。

"Screen" の値: width (pixels) "x" height (pixels) "x" colors (colors
は 2, 4, 8, 16, 32, 64, 128, 256, 32K, 64K, 16M のどれか)

"InputMethod" の値: PEN, KEYBOARD, MOUSE, REMOCON, BUTTON, JOG, ... 
のどれか(複数可)を、読点区切り。 (例では読点の後に SP が。)

以下説明略。面倒だ:-)  理解する側の実装は (まじめにしよーとすると)
面倒だと思うぞ。値の定義がいい加減だ。

ところで [[HTML]] 1.1 ってなに?

* 例

[14] [[利用者エージェントの識別]]も参照。

** RFC 2616 に適合する例

- User-Agent: CERN-LineMode/2.15 libwww/2.17b3
- User-Agent: tin/1.2-PL2
- User-Agent: tin/1.3-950621beta-PL0 (Unix)
- User-Agent: tin/unoff-1.3-BETA-970813 (UNIX) (Linux/2.0.30 (i486))
- User-Agent: tin/pre-1.4-971106 (UNIX) (Linux/2.0.30 (i486))
- User-Agent: Mozilla/4.02b7 (X11; I; en; HP-UX B.10.20 9000/712)
- User-Agent: Microsoft-Internet-News/4.70.1161
- User-Agent: Gnus/5.4.64 XEmacs/20.3beta17 ("Bucharest")
- User-Agent: Pluto/1.05h (RISC-OS/3.1) NewsHound/1.30
- User-Agent: inn/1.7.2
- User-Agent: telnet
- User-Agent: T-gnus/6.14.4 (based on Gnus v5.8.7) (revision 01) REMI/1.14.1 (=?ISO-8859-4?Q?Mushigawa=F2sugi?=) Chao/1.14.1 (=?ISO-8859-4?Q?Rokujiz?= =?ISO-8859-4?Q?=F2?=) APEL/10.2 MULE XEmacs/21.2 (beta33) (Melpomene) (i686-pc-linux)
[[#form:'%text (id => field-body, label => {User-Agent: }, size => 20); (%text(id => name, label => {UA ソフトウェア名}, size => 20);; %text(id => comment, label => {備考}, size => 20);) %submit (label => {追加});':'-[%index;] [CODE(HTTP)[User-Agent: %text (source => field-body);]] %text (source => name, prefix => {(}, suffix => {)});%text (source => comment, prefix => { ※});']]

** USEFOR draft に適合する例

- HTTP に適合するものは、 usefor にも適合します。
- User-Agent: "秀丸エディタ"/3.0 "Microsoft(R) Windows(R) Millenium Edition" (Windows Me)
- [49] User-Agent: "西瓜割"/1.5 Message-pm/1.23
[[#form:'%text (id => field-body, label => {User-Agent: }, size => 20); (%text(id => name, label => {UA ソフトウェア名}, size => 20);; %text(id => comment, label => {備考}, size => 20);) %submit (label => {追加});':'-[%index;] [CODE(HTTP)[User-Agent: %text (source => field-body);]] %text (source => name, prefix => {(}, suffix => {)});%text (source => comment, prefix => { ※});']]


** 間違った例とこれへの対処について

- [1]User-Agent: Mozilla/4.7 [ja]C-{C-UDP; EBM-SONY2}
- [2]User-Agent: DoCoMo/1.0/N503i/c10
- [3]User-Agent: H-Hash@StudyingHTTP.NET
- [4]User-Agent: HttpGet/1.0(Win32; GUI; ix86)
- [5]User-Agent: ネットスケープ 2.0
[[#form:'%text (id => field-body, label => {User-Agent: }, size => 20); (%text(id => name, label => {UA ソフトウェア名}, size => 20);; %text(id => comment, label => {備考}, size => 20);) %submit (label => {追加});':'-[%index;] [CODE(HTTP)[User-Agent: %text (source => field-body);]] %text (source => name, prefix => {(}, suffix => {)});%text (source => comment, prefix => { ※});']]

[34] 間違った例でもそれなりに使われている以上、対応する必要もあるでしょう。
(でも頭が痛いなあ。)

[6] >>1 は、 [ja] 以降の部分で []{}; を使うのを止めるか、全体を
comment にしてしまうべきものでしょう。 usefor 的には {} は
OK なんですが。あるいは全体を quoted-string にするとか。
読む側としては、不正だから無視するのが一番楽。
どうしても読むなら、 http-token の代わりに *<"/" を除く CHAR>
を使うとか。それでも後半が2部分に分かれますが。

[7] >>2 は、 N503i 以降を comment にするか、区切りを "/" じゃなくて "-"
にするとかすべきだったと。読む実装側は・・・悩ましい。

[8] >>3 は、 usefor なら quoted-string にしておくとか。 HTTP では無理だねえ。
(こんなところにメイルアドレスなんて入れるなよ。)
読む側は 1 と同じ対処かな。

[9] >>4 は、 comment の前に SP 入れなさい、って話。 HTTP では必須らしいけど、
usefor 的には無くても OK だねぇ。互換性のために入れた方がいいと
思うけど。読む側は無くても解釈できるのが望ましかろう。

[10] >>5 は、実際、生 [[ISO-2022-JP]] (ならまだ良い。) とか 
[[EUC-JP]] とか
[[シフトJIS]] とか入れる人が少なくないらし。御丁寧にも 
[[encoded-word]]
使う人とかもいるらしいねえ。 なんにせよ、 http-token 以外の文字を
使う時は、 quoted-string にしましょ。 (但し usefor only.)

古い版の MacIE は、日本語版では「ネットスケープ 2.0」とかほざくらしい。
シフト JIS でね。英語版では 「Mozilla/2.0」だったと思われ。藁。

[35] <http://www.dais.is.tohoku.ac.jp/logs/agentgripes.html> からめぼしい(謎)もの。
(適当に上の方から。)

- [11]User-Agent: A.G.E.N.T. http://masui.net/agent/libwww-perl/5.44
- [12]User-Agent: Acoon Robot v1.50.001 (www.acoon.de)

[13] >>11 URI 生書きいや〜ん。 >>12 構文としては問題ないけど''名前/版''形式きぼんぬ。

- [51] どうせ規格に違反するなら、 >>44 の usefor の改良された方法で [[quoted-string]] を使うようにしていった方が、見よう見まねの実装で正しい値を使うようになるんじゃないかと思います。(甘いかな。) ですから新しい実装は、 >>44 の usefor の形式に合致する値を出力するのが望ましいと考えられます。
- [52] >>51 の考え方からすれば、現実的に表現力が小さいだけで何の役にも立っていない今の HTTP の書式を無理に使うよりは、 >>44 の usefor のより自由な方式に (現状では HTTP RFC と一致しなくても) 切り替えていった方が良いかもしれません。
- [53] >>10 HTTP/1.0 ([[RFC1945]]) では、 [CODE(ABNF)[%x80-FF]] は [[ISO-8859-1]] と解釈しても'''良い'''のであって強制ではありませんから、'''注釈の中なら'''シフト JIS を入れたり日本語 EUC を入れたり Big5 を入れたりしても問題ありませんね。して欲しくないけど。更に注釈外の生書きはもちろん駄目だけど。
- [54] >>53 また、 [[encoded-word]] を使う場合も注釈内なら構いませんが、注釈外はいけませんね。 (HTTP の場合)
- [55] 但し、 >>44- のように電子ニュースの手法を使って勝手に拡張してしまうなら、 [SAMP["=?us-ascii?q?A_Sample_User_Agent?= (ASUA)"/"2.45 =?us-ascii?q?=28Lilly=29?="]] みたいなのもありだと思います。 ([[MIME]] 的には [[quoted-string]] の中に [CODE(ABNF)[encoded-word]] を入れるのはよくないんだけど、 HTTP 的にはあまり気にしない。)
- [56] もちろん、 >>55 の例は例であって、 US-ASCII だけの文字列を [CODE(ABNF)[encoded-word]] にするなんてばかげたことは (普通は) しないで下さい、念のため。



* 関連

[93] [CODE(HTTP)@en[[[User-Agent:]]]] には、 [[DOM]] [[API]]
[CODE(JS)@en[[[navigator.userAgent]]]] からもアクセスできます。

[62]
[CODE(822)[User-Agent:]] 欄があるプロトコル:
- [[RFC 822]] 系[[電子メイル]]・[[電子ニュース]]
- [[HTTP]]
- [[RTSP]]
- [[SIP]]

[CODE(822)[User-Agent:]] 欄に関係するプロトコル要素:
- [CODE(CGI)[[[HTTP_USER_AGENT]]]] [[メタ変数]] ([[CGI]])
- [CODE(CGI)[[[SIP_USER_AGENT]]]] [[メタ変数]] ([[SIP CGI]])
- [CODE(JS)[[[navigator]]]] 物体 ([[DOM水準0]])
- [CODE(HTTP)[[[Server]]:]] 欄 ([[HTTP]], [[RTSP]], [[SIP]])

* メモ

[65] [CITE[UserAgent - iPhone 3G DevWiki]]
(Referenced: [TIME[2009-08-25T18:40:39+09:00]])
<http://wiki.sohaya.com/index.php/UserAgent>

[66] [CITE[IRC logs: freenode / #whatwg / 20100617]]
([TIME[2010-06-27 14:30:04 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20100617#l-752>

[67] [CITE[IRC logs: freenode / #whatwg / 20100913]]
( ([TIME[2010-09-26 22:31:37 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20100913>


[77] [CITE@en[draft-karcz-uuas-00 - Unified User-Agent String (UUAS)]]
( ([TIME[2012-04-30 13:21:14 +09:00]] 版))
<http://tools.ietf.org/html/draft-karcz-uuas-00>

[78] [CITE@en-US-x-hixie[HTML Standard]]
( ([TIME[2012-07-26 07:21:45 +09:00]] 版))
<http://www.whatwg.org/specs/web-apps/current-work/#client-identification>


[80] ( ([TIME[2012-11-09 12:46:44 +09:00]] 版))
<http://www.etsi.org/deliver/etsi_ts/102700_102799/102796/01.02.01_60/ts_102796v010201p.pdf>

[94] [CITE@en[Re: History of device independence, User-Agent header?]]
( ([[Sean B. Palmer]] 著, [TIME[2014-07-15 04:42:58 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-webhistory/2014Jul/0001.html>

[95] [CITE@en[RFC 3507 - Internet Content Adaptation Protocol (ICAP)]]
( ([TIME[2014-06-08 07:17:07 +09:00]] 版))
<http://tools.ietf.org/html/rfc3507#page-14>

[96] [CITE@en[''''''[''''''whatwg'''''']'''''' Controlling the User-Agent header from script]]
( ([[Anne van Kesteren]] 著, [TIME[2014-10-13 22:53:20 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Oct/0151.html>

[97] [CITE[The Platform for Privacy Preferences 1.0 (P3P1.0) Specification]]
( ([TIME[2002-04-16 22:03:48 +09:00]] 版))
<http://www.w3.org/TR/P3P/#other_http_info>

[98] [CITE@en[RFC 5536 - Netnews Article Format]]
( ([TIME[2014-09-21 18:14:06 +09:00]] 版))
<http://tools.ietf.org/html/rfc5536#section-3.2.13>

[38] [CITE@en[RFC 5965 - An Extensible Format for Email Feedback Reports]]
([TIME[2014-12-21 09:40:25 +09:00]] 版)
<http://tools.ietf.org/html/rfc5965#section-3.1>

[39] >>38 は [[RFC 2616]] を引用して [CODE(MIME)@en[[[message/feedback-report]]]]
における [CODE[[[User-Agent:]]]] を規定していますが、ここでは構文上の[[空白]]が
[[CFWS]] に置き換えられています。 [CODE(ABNF)@en[[[comment]]]] を値の先頭に置くことができます。


[FIG(quote)[
[FIGCAPTION[
[100] [CITE[Connecting to a streaming endpoint | Twitter Developers]]
([TIME[2015-03-05 11:50:39 +09:00]] 版)
<https://dev.twitter.com/streaming/overview/connecting>
]FIGCAPTION]

> If your environment precludes setting the User-Agent field, then set an X-User-Agent header.

]FIG]


[101] [CITE@en[`user-agent` header control · Issue #37 · whatwg/fetch]]
([TIME[2015-04-06 11:34:07 +09:00]] 版)
<https://github.com/whatwg/fetch/issues/37>

[102] [CITE@en[Re: user-agent header control]]
([[Anne van Kesteren]] 著, [TIME[2015-04-06 04:12:09 +09:00]] 版)
<https://lists.w3.org/Archives/Public/public-webapps/2015AprJun/0043.html>

[105] [CITE@en[Allow User-Agent to be set, but not omitted. Also group all the heade… · whatwg/fetch@dab09b0]]
([TIME[2015-07-30 14:22:21 +09:00]] 版)
<https://github.com/whatwg/fetch/commit/dab09b0c483c46324082df1e54b29ed4c9c02162>


[123] [CITE@en[Issue 310456 - chromium - FTP not working behind Authenticating HTTP Proxy using NTLM (Forefront TMG) - Monorail]]
( ([TIME[2016-06-11 12:48:19 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=310456#c18>

[FIG(quote)[
[FIGCAPTION[
[124] [CITE[ARIB TR-B39]]
([TIME[2016-07-25 17:01:00 +09:00]])
<http://www.arib.or.jp/english/html/overview/doc/4-TR-B39v1_0-1p4.pdf#page=309>
]FIGCAPTION]

> HTML ブラウザは、User-Agent ヘッダを図 10-7 に示す書式に合わせて HTTP リクエストのヘ
> ッダに含めて送信しなければならない。
> User-Agent: <others> <SystemName>/1.0
> (<Capability>;<MakerId>;<ModelId>;<MajorVer>;<MinorVer>;
> <reserved>) <others>
> 図 10-7 User-Agent ヘッダ
> <SystemName> : "A-PAB"
> < Capability > : 受信機の能力を表す。
> カンマ(",")区切りで受信機の能力を表す文字列を列挙するものとし、先頭から順に、ブラウザ
> 表示解像度、ビデオ再生解像度を表現する。それ以降の項目については将来の規定項目とする。
> <Capability>=browser_resolution","video_resolution[","reserved]
> browser_resolution="2K"|"4K"|"8K"
> video_resolution="2K"|"4K"|"8K"
> browser_resolution はブラウザで表示可能な最大のコンテンツの解像度を示し、
> video_resolution は video 要素によって再生可能な最大の解像度を示す。それぞれ
> "2K","4K","8K"のいづれかが記述される。記述がない場合は"2K"と見なす。なお、"4K"に
> 対応するものは"2K"にも対応し、"8K"に対応するものは"4K"および"2K"にも対応するもの
> とする。
> <MakerId>:製造メーカーの識別を示す。
> MakerId は 6 桁の文字列で、IEEE 規定の 24bit のカンパニーID(OUI)を base16 の文字列
> で表したものとする。メーカーに対して OUI は複数存在する可能性があるが、そのうち特定
> の1種類を MakerId として使用すること。
> < ModelId >:機種を示すコードであり、10 文字までの文字列である。運用は各メーカーに任され
> る。
> <MajorVer><MinorVer>: 端末のバージョン情報を示し、共に 8 文字までの文字列とする。
> ModelId が同一で、動作が異なる端末には、異なるバージョンを付する。運用は各メーカーに
> 任される。
> <reserved>:将来の拡張のための領域
> <others>: メーカーが自由に使える領域。ただし、本規定の識別子と区別するため、
> <SystemName>で文字列が始まらない必要がある。なお、使用する文字列は RFC 7231 に従
> うものとする。 
> 

]FIG]



[127] 
[CODE[Mozilla/5.0 (Linux; Android 7.0; 502SO Build/39.2.D.0.211; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36 インターネット/3.0.2.2]]
「インターネット」は[[半角カナ]]。
[TIME[2017-05-29T08:10:43.200Z]]

[FIG(quote)[
[FIGCAPTION[
[128] [CITE@en[GitHub API v3 | GitHub Developer Guide]]
([TIME[2017-06-10 05:53:45 +09:00]])
<https://developer.github.com/v3/#user-agent-required>
]FIGCAPTION]

> All API requests MUST include a valid User-Agent header. Requests with no User-Agent header will be rejected. We request that you use your GitHub username, or the name of your application, for the User-Agent header value.

]FIG]


[15] [CITE@ja[Chromiumベースの新Microsoft Edgeは接続先に応じて別のブラウザに偽装する | スラド IT]]
([TIME[2019-04-23 21:48:49 +09:00]])
<https://it.srad.jp/story/19/04/23/0527248/>

[16] [CITE@en[182629 – '''['''macOS, iOS''']''' Expose OS marketing version in UserAgent]]
([TIME[2019-06-22 12:08:24 +09:00]])
<https://bugs.webkit.org/show_bug.cgi?id=182629>

[22] [CITE@ja[User Agent Changes | Vivaldi Browser]]
([TIME[2019-12-21 09:26:22 +09:00]])
<https://vivaldi.com/ja/blog/user-agent-changes/>

[23] [CITE[Intent to Deprecate and Freeze: The User-Agent string - Google グループ]]
([TIME[2020-01-17 16:38:45 +09:00]])
<https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/-2JIRNMWJ7s/yHe4tQNLCgAJ>

[24] [CITE@en[Freeze the User Agent string - Chrome Platform Status]]
([TIME[2020-01-17 16:39:16 +09:00]])
<https://www.chromestatus.com/feature/5704553745874944>

[25] [CITE@en[User Agent Client Hints · Issue #202 · mozilla/standards-positions]]
([TIME[2020-01-17 16:41:25 +09:00]])
<https://github.com/mozilla/standards-positions/issues/202>

[30] [CITE@en[Remove OS build number from user-agent string - Chrome Platform Status]]
([TIME[2020-01-17 16:41:53 +09:00]])
<https://www.chromestatus.com/feature/4558585463832576>

[36] [CITE@en[Chromium Blog: Changing the Chrome on iOS User Agent for Request Desktop Site]]
([TIME[2020-09-15T15:16:41.000Z]], [TIME[2020-09-17T01:13:51.396Z]])
<https://blog.chromium.org/2020/09/changing-chrome-on-ios-user-agent-for.html>

[FIG(quote)[
[FIGCAPTION[
[43] [CITE@ja[はてなブログの2020年9月の機能修正・改善をお知らせします(7件) - はてなブログ開発ブログ]]
([TIME[2020-10-02T01:14:26.000Z]])
<https://staff.hatenablog.com/entry/2020/10/01/130000>
]FIGCAPTION]

> User-Agentにbotが含まれていたため、Flickrをクロールする際にアクセスができず、画像を取得できない問題がありましたがこの修正により解消しました。

]FIG]


[50] [CITE@ja[作ろうiモードコンテンツ:ユーザエージェント | サービス・機能 | NTTドコモ]]
([TIME[2020-12-29T11:13:39.000Z]])
<https://www.nttdocomo.co.jp/service/developer/make/content/spec/useragent/index.html>

[57] [CITE@ja[作ろうiモード:ユーザエージェント | サービス・機能 | NTTドコモ]]
([TIME[2020-12-29T11:20:25.000Z]])
<https://www.nttdocomo.co.jp/service/developer/make/content/browser/browser2/useragent/index.html>

[58] [CITE@en[Downgrade User Agent Client Hints to 'harmful' · Issue #552 · mozilla/standards-positions]]
([TIME[2021-07-22T03:40:04.000Z]])
<https://github.com/mozilla/standards-positions/issues/552>

[60] [CITE@en[User-Agent Reduction origin trial - Chrome Developers]]
([TIME[1980-01-01T00:00:01.000Z]], [TIME[2021-09-17T01:12:24.799Z]])
<https://developer.chrome.com/blog/user-agent-reduction-origin-trial/>

[63] [CITE@en[User-Agent Reduction origin trial - Chrome Developers]]
([TIME[1980-01-01T00:00:01.000Z]], [TIME[2021-09-17T01:12:43.762Z]])
<https://developer.chrome.com/blog/user-agent-reduction-origin-trial/>

[64] [CITE@en[1719070 - Add Nimbus client code for "Firefox/100.0" UA string experiment]]
([TIME[2021-12-17T02:57:36.000Z]])
<https://bugzilla.mozilla.org/show_bug.cgi?id=1719070>

[69] [CITE@ja[Apple の緊急セキュリティ対応、一部サイトが正しく表示されなくなる問題 | スラド アップル]], [TIME[2023-07-18T14:41:18.000Z]] <https://apple.srad.jp/story/23/07/12/181232/>

>問題が発生しているのは iOS 16.5.1 (a) / iPadOS 16.5.1 (a) / macOS Ventura 13.4.1 (a) で、それぞれ問題を修正した iOS 16.5.1 (b) / iPadOS 16.5.1 (b) / macOS Ventura 13.4.1 (b) を間もなくリリースするとのこと。
>
問題の原因は Safari のユーザーエージェント文字列に「(a)」が含められたこととみられる。これにより、Facebook や Instagram などのサイトが古いバージョンのブラウザーと誤認識してしまうようだ。



