Skip to content

Commit f246aaf

Browse files
committed
Add frame-ancestors to README
1 parent 9e23310 commit f246aaf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ blocks many XSS attacks, but Content Security Policy is recommended to use compa
321321
connectSrc: string | string[];
322322
defaultSrc: string | string[];
323323
fontSrc: string | string[];
324+
frameAncestors: string | string[];
324325
frameSrc: string | string[];
325326
imgSrc: string | string[];
326327
manifestSrc: string | string[];
@@ -375,6 +376,12 @@ If you give true to `reportOnly` , this sets "Content-Security-Policy-Report-Onl
375376

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

379+
#### When setting `frameAncestors`
380+
381+
**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.
382+
383+
Therefore, if setting `frameAncestors` you should set `frameGuard` to `false`.
384+
378385
### `expectCT`
379386
```ts
380387
{

0 commit comments

Comments
 (0)