Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The DPR header is a Client Hints headers which represents the client device pixel ratio (DPR), which is the the number of physical device pixels corresponding to every CSS pixel.
| Header type | Request header |
|---|---|
| Forbidden header name | ? |
Note: Client Hints are accessible only on secure origins (via TLS). Server has to opt in to receive DPR header from the client by sending Accept-CH and Accept-CH-Lifetime response headers.
Syntax
DPR: <number>
Examples
Server first needs to opt in to receive DPR header by sending the response headers Accept-CH containing DPR and Accept-CH-Lifetime.
Accept-CH: DPR Accept-CH-Lifetime: 86400
Then on subsequent requests the client might send DPR header back:
DPR: 1.0
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
DPR | Chrome Full support 46 | Edge Full support ≤79 | Firefox ? | IE ? | Opera Full support 33 | Safari ? | WebView Android Full support 46 | Chrome Android Full support 46 | Firefox Android ? | Opera Android Full support 33 | Safari iOS ? | Samsung Internet Android Full support 5.0 |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
