You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/user/validation.mdx
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,14 @@ In the example above, there is a `<meta>` CSP element, so capo.js warns that "CS
116
116
117
117
This validation warning is an example of capo.js being more opinionated than simply following the specification. The warning includes a recommendation to use the CSP header instead, which avoids the preload scanner issue all together. Also note that the `Content-Security-Policy-Report-Only` directive is only valid as an HTTP header and not as a `<meta http-equiv>` element.
118
118
119
+
Additionally, some CSP directives are not allowed in the `<meta>` declaration:
120
+
121
+
-`frame-ancestors`
122
+
-`sandbox`
123
+
-`report-uri`
124
+
125
+
If capo.js detects any of these directives in a `<meta>` CSP element, it will log a validation warning.
126
+
119
127
### No invalid origin trials
120
128
121
129
Sites can register for [origin trials](https://developer.chrome.com/en/docs/web-platform/origin-trials/) to enable individual experimental web platform features. To enable them on a given site, a token must be included as either an `Origin-Trial` HTTP header or `<meta http-equiv>` element.
if("report-uri"indirectives)warnings.push("The report-uri directive is not supported. Use the Content-Security-Policy-Report-Only HTTP header instead.");
568
+
if("frame-ancestors"indirectives)warnings.push("The frame-ancestors directive is not supported. Use the Content-Security-Policy HTTP header instead.");
569
+
if("sandbox"indirectives)warnings.push("The sandbox directive is not supported. Use the Content-Security-Policy HTTP header instead.");
if("report-uri"indirectives)warnings.push("The report-uri directive is not supported. Use the Content-Security-Policy-Report-Only HTTP header instead.");
569
+
if("frame-ancestors"indirectives)warnings.push("The frame-ancestors directive is not supported. Use the Content-Security-Policy HTTP header instead.");
570
+
if("sandbox"indirectives)warnings.push("The sandbox directive is not supported. Use the Content-Security-Policy HTTP header instead.");
0 commit comments