|
5 | 5 | namespace CefSharp |
6 | 6 | { |
7 | 7 | /// <summary> |
8 | | - /// Values that represent referrer policies. |
| 8 | + /// Policy for how the Referrer HTTP header value will be sent during navigation. |
| 9 | + /// If the `--no-referrers` command-line flag is specified then the policy value |
| 10 | + /// will be ignored and the Referrer value will never be sent. |
| 11 | + /// Must be kept synchronized with net::URLRequest::ReferrerPolicy from Chromium. |
9 | 12 | /// </summary> |
10 | 13 | public enum ReferrerPolicy |
11 | 14 | { |
12 | 15 | /// <summary> |
13 | | - /// Always send the complete Referrer value. |
| 16 | + /// Clear the referrer header if the header value is HTTPS but the request |
| 17 | + /// destination is HTTP. This is the default behavior. |
14 | 18 | /// </summary> |
15 | | - Always = 0, |
| 19 | + ClearReferrerOnTransitionFromSecureToInsecure, |
16 | 20 |
|
17 | 21 | /// <summary> |
18 | | - /// Use the default policy. This is OriginWhenCrossOrigin |
19 | | - /// when the `--reduced-referrer-granularity` command-line flag is specified |
20 | | - /// and NoReferrerWhenDowngrade otherwise. |
| 22 | + /// Default which is equivilent to <see cref="ClearReferrerOnTransitionFromSecureToInsecure"/> |
21 | 23 | /// </summary> |
22 | | - Default, |
| 24 | + Default = ClearReferrerOnTransitionFromSecureToInsecure, |
23 | 25 |
|
24 | 26 | /// <summary> |
25 | | - /// When navigating from HTTPS to HTTP do not send the Referrer value. |
26 | | - /// Otherwise, send the complete Referrer value. |
| 27 | + /// A slight variant on <see cref="ClearReferrerOnTransitionFromSecureToInsecure"/>: |
| 28 | + /// If the request destination is HTTP, an HTTPS referrer will be cleared. If |
| 29 | + /// the request's destination is cross-origin with the referrer (but does not |
| 30 | + /// downgrade), the referrer's granularity will be stripped down to an origin |
| 31 | + /// rather than a full URL. Same-origin requests will send the full referrer. |
27 | 32 | /// </summary> |
28 | | - NoReferrerWhenDowngrade, |
| 33 | + ReduceReferrerGranularityOnTransitionCrossOrigin, |
29 | 34 |
|
30 | 35 | /// <summary> |
31 | | - /// Never send the Referrer value. |
| 36 | + /// Strip the referrer down to an origin when the origin of the referrer is |
| 37 | + /// different from the destination's origin. |
32 | 38 | /// </summary> |
33 | | - Never, |
| 39 | + OriginOnlyOnTransitionCrossOrigin, |
34 | 40 |
|
35 | 41 | /// <summary> |
36 | | - /// Only send the origin component of the Referrer value. |
| 42 | + /// Never change the referrer. |
| 43 | + /// </summary> |
| 44 | + NeverClearReferrer, |
| 45 | + |
| 46 | + /// <summary> |
| 47 | + /// Strip the referrer down to the origin regardless of the redirect location. |
37 | 48 | /// </summary> |
38 | 49 | Origin, |
39 | 50 |
|
40 | 51 | /// <summary> |
41 | | - /// When navigating cross-origin only send the origin component of the Referrer value. Otherwise, send the complete Referrer value. |
| 52 | + /// Clear the referrer when the request's referrer is cross-origin with the |
| 53 | + /// request's destination. |
| 54 | + /// </summary> |
| 55 | + ClearReferrerOnTransitionCrossOrigin, |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// Strip the referrer down to the origin, but clear it entirely if the |
| 59 | + /// referrer value is HTTPS and the destination is HTTP. |
| 60 | + /// </summary> |
| 61 | + OriginClearOnTransitionFromSecureToInsecure, |
| 62 | + |
| 63 | + /// <summary> |
| 64 | + /// Always clear the referrer regardless of the request destination. |
| 65 | + /// </summary> |
| 66 | + NoReferrer, |
| 67 | + |
| 68 | + /// <summary> |
| 69 | + /// Always the last value in this enumeration. |
42 | 70 | /// </summary> |
43 | | - OriginWhenCrossOrigin |
| 71 | + LastValue = NoReferrer, |
44 | 72 | } |
45 | 73 | } |
0 commit comments