Web Security · Junior · Question 69 of 75
How do you stop other sites from framing your pages?
- 1Add
target="_blank"to all links - ✓Correct answer: Send
Content-Security-Policy: frame-ancestors 'none'(or'self'), orX-Frame-Options: DENYfor old browsers - 3Use
display: noneon the<body>until the page loads
Explanation
frame-ancestors is the modern standard. X-Frame-Options is the older header with the same purpose.