默认 Accept 值列表
本文档记录了特定输入和浏览器版本下 HTTP Accept 标头的默认值。
默认值
这些是在上下文无法提供更多信息时发送的值。请注意,所有浏览器都会添加 */* MIME 类型以涵盖所有情况。这通常用于通过浏览器地址栏或通过 HTML <a> 元素发起的请求。
| 用户代理 | 值 |
|---|---|
| Firefox 128 及更高版本 [1] | text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 |
| Firefox 92 至 127 [1] | text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8 |
| Firefox 72 至 91 [2] | text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 |
| Firefox 66 至 71 [2] | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
| Firefox 65 [2] | text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 |
| Firefox 64 及更早版本 [2] | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
| Safari、Chrome | text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 |
| Safari 5 [3] | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
| Edge | text/html, application/xhtml+xml, image/jxr, */* |
| Opera | text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 |
[1] 使用 network.http.accept 首选项(about:config)可以将该值设置为任意字符串。
[2] 使用 network.http.accept.default 首选项(about:config)可以将该值设置为任意字符串。
[3] 这是对早期 Accept 标头的改进,因为它不再将 image/png 的优先级排在 text/html 之上。
图像的值
在请求图像时,例如通过 HTML <img> 元素,用户代理通常会设置一个特定的媒体类型列表。
| 用户代理 | 值 |
|---|---|
| Firefox 128 及更高版本 [1] | image/avif,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5 |
| Firefox 92 至 127 [1] | image/avif,image/webp,*/* |
| Firefox 65 至 91 [1] | image/webp,*/* |
| Firefox 47 至 63 [1] | */* |
| Firefox 47 之前的版本 [1] | image/png,image/*;q=0.8,*/*;q=0.5 |
| Safari(自 macOS Big Sur 起) | image/webp,image/png,image/svg+xml,image/*;q=0.8,video/*;q=0.8,*/*;q=0.5 |
| Safari(macOS Big Sur 之前) | image/png,image/svg+xml,image/*;q=0.8,video/*;q=0.8,*/*;q=0.5 |
| Chrome 和 Edge 121 及更高版本 | image/avif,image/webp,image/apng,image/*,*/*;q=0.8 |
[1] 使用 image.http.accept 参数(源代码)可以将该值设置为任意字符串。
视频的值
音频资源的值
脚本的值
CSS 样式表的值
当通过 <link rel="stylesheet"> HTML 元素请求 CSS 样式表时,大多数浏览器都会使用特定的值。
| 用户代理 | 值 |
|---|---|
| Firefox 4 [1] | text/css,*/*;q=0.1 |
| Safari、Chrome | text/css,*/*;q=0.1 |
| Opera 11.10 | text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 |
| Konqueror 4.6 | text/css,*/*;q=0.1 |
[1] 请参阅 错误 170789。