Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ blocks many XSS attacks, but Content Security Policy is recommended to use compa
| "allow-top-navigation-by-user-activation";
}>
& Partial<{
formAction: string | string[];
frameAncestors: string | string[];
navigateTo: string | string[];
reportURI: string | URL | (string | URL)[];
reportTo: string;
Expand All @@ -375,6 +377,11 @@ If you give true to `reportOnly` , this sets "Content-Security-Policy-Report-Onl

Also you can specify directives using chain-case names such as `child-src` instead of `childSrc` .

> **❗️ When setting `frameAncestors` :X-Frame-Options takes priority.**
> [Section "Relation to X-Frame-Options" of the CSP Spec](https://w3c.github.io/webappsec-csp/#frame-ancestors-and-frame-options) says: _"If a resource is delivered with a policy that includes a directive named frame-ancestors and whose disposition is "enforce", then the X-Frame-Options header MUST be ignored"_, but Chrome 40 & Firefox 35 ignore the frame-ancestors directive and follow the X-Frame-Options header instead.
>
> Therefore, if setting `frameAncestors` you should set `frameGuard` to `false`.

### `expectCT`
```ts
{
Expand Down