CSP: Frame-src - HTTP - MDN Web Docs - Mozilla
Có thể bạn quan tâm
- References
- HTTP
- Headers
- Content-Security-Policy
- CSP: frame-src
- English (US)
- Remember language
- Deutsch
- Français
- 日本語
- Syntax
- Examples
- Specifications
- Browser compatibility
- See also
- HTTP
- Guides
- An overview of HTTP
- A typical HTTP session
- HTTP messages
- MIME types (IANA media types)
- Compression in HTTP
- HTTP caching
- HTTP authentication
- Using HTTP cookies
- Redirections in HTTP
- HTTP conditional requests
- HTTP range requests
- Content negotiation
- Connection management in HTTP/1.x
- Evolution of HTTP
- Protocol upgrade mechanism
- Proxy servers and tunneling
- HTTP Client hints
- Security and privacy
- Practical security implementation guides
- HTTP Observatory
- Permissions Policy Experimental
- Content Security Policy (CSP)
- Cross-Origin Resource Sharing (CORS)
- Cross-Origin Resource Policy (CORP)
- Headers
- References
- HTTP headers
- Accept
- Accept-CH
- Accept-Encoding
- Accept-Language
- Accept-Patch
- Accept-Post
- Accept-Ranges
- Access-Control-Allow-Credentials
- Access-Control-Allow-Headers
- Access-Control-Allow-Methods
- Access-Control-Allow-Origin
- Access-Control-Expose-Headers
- Access-Control-Max-Age
- Access-Control-Request-Headers
- Access-Control-Request-Method
- Age
- Allow
- Alt-Svc
- Alt-Used
- Attribution-Reporting-Eligible Experimental
- Attribution-Reporting-Register-Source Experimental
- Attribution-Reporting-Register-Trigger Experimental
- Authorization
- Cache-Control
- Clear-Site-Data
- Connection
- Content-Digest
- Content-Disposition
- Content-DPR Non-standard Deprecated
- Content-Encoding
- Content-Language
- Content-Length
- Content-Location
- Content-Range
- Content-Security-Policy
- Content-Security-Policy-Report-Only
- Content-Type
- Cookie
- Critical-CH Experimental
- Cross-Origin-Embedder-Policy
- Cross-Origin-Opener-Policy
- Cross-Origin-Resource-Policy
- Date
- Device-Memory
- DNT Non-standard Deprecated
- Downlink Experimental
- DPR Non-standard Deprecated
- Early-Data Experimental
- ECT Experimental
- ETag
- Expect
- Expect-CT Deprecated
- Expires
- Forwarded
- From
- Host
- If-Match
- If-Modified-Since
- If-None-Match
- If-Range
- If-Unmodified-Since
- Keep-Alive
- Last-Modified
- Link
- Location
- Max-Forwards
- NEL Experimental
- No-Vary-Search Experimental
- Observe-Browsing-Topics Experimental Non-standard
- Origin
- Origin-Agent-Cluster Experimental
- Permissions-Policy Experimental
- Pragma Deprecated
- Priority
- Proxy-Authenticate
- Proxy-Authorization
- Range
- Referer
- Referrer-Policy
- Refresh
- Report-To Non-standard Deprecated
- Reporting-Endpoints Experimental
- Repr-Digest
- Retry-After
- RTT Experimental
- Save-Data Experimental
- Sec-Browsing-Topics Experimental Non-standard
- Sec-CH-Prefers-Color-Scheme Experimental
- Sec-CH-Prefers-Reduced-Motion Experimental
- Sec-CH-Prefers-Reduced-Transparency Experimental
- Sec-CH-UA Experimental
- Sec-CH-UA-Arch Experimental
- Sec-CH-UA-Bitness Experimental
- Sec-CH-UA-Full-Version Deprecated
- Sec-CH-UA-Full-Version-List Experimental
- Sec-CH-UA-Mobile Experimental
- Sec-CH-UA-Model Experimental
- Sec-CH-UA-Platform Experimental
- Sec-CH-UA-Platform-Version Experimental
- Sec-Fetch-Dest
- Sec-Fetch-Mode
- Sec-Fetch-Site
- Sec-Fetch-User
- Sec-GPC Experimental
- Sec-Purpose
- Sec-WebSocket-Accept
- Sec-WebSocket-Extensions
- Sec-WebSocket-Key
- Sec-WebSocket-Protocol
- Sec-WebSocket-Version
- Server
- Server-Timing
- Service-Worker
- Service-Worker-Allowed
- Service-Worker-Navigation-Preload
- Set-Cookie
- Set-Login Experimental
- SourceMap
- Speculation-Rules Experimental
- Strict-Transport-Security
- Supports-Loading-Mode Experimental
- TE
- Timing-Allow-Origin
- Tk Non-standard Deprecated
- Trailer
- Transfer-Encoding
- Upgrade
- Upgrade-Insecure-Requests
- User-Agent
- Vary
- Via
- Viewport-Width Non-standard Deprecated
- Want-Content-Digest
- Want-Repr-Digest
- Warning Deprecated
- Width Non-standard Deprecated
- WWW-Authenticate
- X-Content-Type-Options
- X-DNS-Prefetch-Control Non-standard
- X-Forwarded-For Non-standard
- X-Forwarded-Host Non-standard
- X-Forwarded-Proto Non-standard
- X-Frame-Options Deprecated
- X-Permitted-Cross-Domain-Policies Non-standard
- X-Powered-By Non-standard
- X-Robots-Tag Non-standard
- X-XSS-Protection Non-standard Deprecated
- HTTP request methods
- CONNECT
- DELETE
- GET
- HEAD
- OPTIONS
- PATCH
- POST
- PUT
- TRACE
- HTTP response status codes
- 100 Continue
- 101 Switching Protocols
- 102 Processing
- 103 Early Hints
- 200 OK
- 201 Created
- 202 Accepted
- 203 Non-Authoritative Information
- 204 No Content
- 205 Reset Content
- 206 Partial Content
- 207 Multi-Status
- 208 Already Reported
- 226 IM Used
- 300 Multiple Choices
- 301 Moved Permanently
- 302 Found
- 303 See Other
- 304 Not Modified
- 307 Temporary Redirect
- 308 Permanent Redirect
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Content
- 423 Locked
- 424 Failed Dependency
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
- 505 HTTP Version Not Supported
- 506 Variant Also Negotiates
- 507 Insufficient Storage
- 508 Loop Detected
- 510 Not Extended
- 511 Network Authentication Required
- CSP directives
- CSP: base-uri
- CSP: block-all-mixed-content Deprecated
- CSP: child-src
- CSP: connect-src
- CSP: default-src
- CSP: fenced-frame-src Experimental
- CSP: font-src
- CSP: form-action
- CSP: frame-ancestors
- CSP: frame-src
- CSP: img-src
- CSP: manifest-src
- CSP: media-src
- CSP: object-src
- CSP: prefetch-src Non-standard Deprecated
- CSP: report-to
- CSP: report-uri Deprecated
- CSP: require-trusted-types-for Experimental
- CSP: sandbox
- CSP: script-src
- CSP: script-src-attr
- CSP: script-src-elem
- CSP: style-src
- CSP: style-src-attr
- CSP: style-src-elem
- CSP: trusted-types Experimental
- CSP: upgrade-insecure-requests
- CSP: worker-src
- CORS errors
- Reason: CORS disabled
- Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz'
- Reason: CORS header 'Access-Control-Allow-Origin' missing
- Reason: CORS header 'Origin' cannot be added
- Reason: CORS preflight channel did not succeed
- Reason: CORS request did not succeed
- Reason: CORS request external redirect not allowed
- Reason: CORS request not HTTP
- Reason: Credential is not supported if the CORS header 'Access-Control-Allow-Origin' is '*'
- Reason: Did not find method in CORS header 'Access-Control-Allow-Methods'
- Reason: expected 'true' in CORS header 'Access-Control-Allow-Credentials'
- Reason: invalid token 'xyz' in CORS header 'Access-Control-Allow-Headers'
- Reason: invalid token 'xyz' in CORS header 'Access-Control-Allow-Methods'
- Reason: missing token 'xyz' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel
- Reason: Multiple CORS header 'Access-Control-Allow-Origin' not allowed
- Permissions-Policy directives
- Permissions-Policy: accelerometer Experimental
- Permissions-Policy: ambient-light-sensor Experimental
- Permissions-Policy: attribution-reporting Experimental
- Permissions-Policy: autoplay Experimental
- Permissions-Policy: bluetooth Experimental
- Permissions-Policy: browsing-topics Experimental Non-standard
- Permissions-Policy: camera Experimental
- Permissions-Policy: compute-pressure Experimental
- Permissions-Policy: cross-origin-isolated Experimental
- Permissions-Policy: display-capture Experimental
- Permissions-Policy: document-domain Experimental
- Permissions-Policy: encrypted-media Experimental
- Permissions-Policy: fullscreen Experimental
- Permissions-Policy: gamepad Experimental
- Permissions-Policy: geolocation Experimental
- Permissions-Policy: gyroscope Experimental
- Permissions-Policy: hid Experimental
- Permissions-Policy: identity-credentials-get Experimental
- Permissions-Policy: idle-detection Experimental
- Permissions-Policy: local-fonts Experimental
- Permissions-Policy: magnetometer Experimental
- Permissions-Policy: microphone Experimental
- Permissions-Policy: midi Experimental
- Permissions-Policy: otp-credentials Experimental
- Permissions-Policy: payment Experimental
- Permissions-Policy: picture-in-picture Experimental
- Permissions-Policy: publickey-credentials-create Experimental
- Permissions-Policy: publickey-credentials-get Experimental
- Permissions-Policy: screen-wake-lock Experimental
- Permissions-Policy: serial Experimental
- Permissions-Policy: speaker-selection Experimental
- Permissions-Policy: storage-access Experimental
- Permissions-Policy: usb Experimental
- Permissions-Policy: web-share Experimental
- Permissions-Policy: window-management Experimental
- Permissions-Policy: xr-spatial-tracking Experimental
- HTTP resources and specifications
- Syntax
- Examples
- Specifications
- Browser compatibility
- See also
The HTTP Content-Security-Policy (CSP) frame-src directive specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>.
Note: frame-src allows you to specify where iframes in a page may be loaded from. This differs from frame-ancestors, which allows you to specify what parent source may embed a page.
CSP version | 1 |
---|---|
Directive type | Fetch directive |
Fallback | If this directive is absent, the user agent will look for the child-src directive (which falls back to the default-src directive). |
Syntax
httpContent-Security-Policy: frame-src 'none'; Content-Security-Policy: frame-src <source-expression-list>;This directive may have one of the following values:
'none'No resources of this type may be loaded. The single quotes are mandatory.
<source-expression-list>A space-separated list of source expression values. Resources of this type may be loaded if they match any of the given source expressions. For this directive, the following source expression values are applicable:
- <host-source>
- <scheme-source>
- 'self'
Examples
Violation cases
Given this CSP header:
httpContent-Security-Policy: frame-src https://example.com/The following <iframe> is blocked and won't load:
html<iframe src="https://not-example.com/"></iframe>Specifications
Specification |
---|
Content Security Policy Level 3 # directive-frame-src |
Browser compatibility
BCD tables only load in the browser
See also
- Content-Security-Policy
- <frame> and <iframe>
- frame-ancestors
Help improve MDN
Was this page helpful to you?YesNoLearn how to contribute.This page was last modified on Nov 19, 2024 by MDN contributors.
View this page on GitHub • Report a problem with this contentTừ khóa » Thẻ Frame Src
-
Cách Sử Dụng Thẻ Frame Trong HTML - Web Cơ Bản
-
Thẻ - Trắc Nghiệm Online
-
Thẻ | Thẻ HTML
-
Thẻ | 7scv
-
Frame Trong HTML - Học HTML Online - VietTuts
-
Hỏi: Thẻ | Thầy Hùng
-
Thẻ Frame Trong HTML - ge
-
Thẻ
-
Sử Dụng Khung Frame
-
Thiết Kế Khung (Frame) Trong HTML
-
HTML Frame Tag - W3Schools
-
Frames - HTML
-
Frame Là Gì? - Từ điển CNTT - Dictionary4it
-
Thẻ NOFRAMES Nhúng Frame - Thẻ IFRAME - Tài Liệu Text - 123doc