Clickjacking Test.
Check X-Frame-Options and CSP frame-ancestors on a public URL, then apply header fixes.
Implementation Guide
Best Practices Overview
- • Always implement both X-Frame-Options and CSP frame-ancestors
- • Use SAMEORIGIN unless you specifically need to block all framing
- • Test implementation across different browsers
- • Consider adding JavaScript frame-busting code as an additional layer
- • Regularly audit your security headers
Apache Server
Add to your .htaccess file or server configuration:
# X-Frame-Options
Header always append X-Frame-Options SAMEORIGIN
# Content Security Policy
Header always set Content-Security-Policy "frame-ancestors 'self';"Note: Make sure mod_headers is enabled on your Apache server.
Additional JavaScript Protection
While not a replacement for proper header-based protection, you can add this JavaScript code as an extra security layer:
// Add to your main JavaScript file
if (window.top !== window.self) {
window.top.location = window.self.location;
}
// Alternative method
if (window !== window.top) {
window.top.location.href = window.location.href;
}Testing Your Implementation
After implementing protection, verify it using:
- 1. This clickjacking tester tool
- 2. Browser developer tools (Network tab)
- 3. Online security header checkers
- 4. Create a test page that tries to frame your site
Need help hardening a production site?
For application security reviews and secure delivery practices, see Infyways security services.
How it works
Four steps.
- 01
Enter a public website URL to test for clickjacking protection.
- 02
Run the check for X-Frame-Options and CSP frame-ancestors headers.
- 03
Review the analysis and open the implementation guide for your stack.
- 04
Apply the recommended headers, then re-test the URL.
Features
What this clickjacking test covers.
Header analysis
Checks X-Frame-Options and Content-Security-Policy frame-ancestors on the response.
Frame policy readout
Shows whether the site allows framing and how restrictive the policy is.
Risk summary
Flags missing or weak clickjacking defenses so you know what to fix first.
Stack fix examples
Copy header snippets for Apache, Nginx, Express, Next.js, Django, and ASP.NET.
frame-ancestors guidance
Explains CSP frame-ancestors alongside classic X-Frame-Options values.
Re-test workflow
After you deploy headers, run the same URL again to confirm protection.
What does this clickjacking test check?
It inspects a public URL for framing defenses, especially X-Frame-Options and CSP frame-ancestors , then summarizes how protected the response looks.
Which headers should I set?
Prefer both layers: X-Frame-Options: SAMEORIGIN (or DENY) and Content-Security-Policy: frame-ancestors 'self' (or 'none'). The guide shows copy-paste snippets for common stacks.
Does JavaScript frame-busting replace headers?
No. Frame-busting scripts are an optional extra layer. Modern browsers rely on response headers; use the snippets in the Implementation Guide as the primary fix.
Can I test private or localhost sites?
The tester needs a publicly reachable URL so headers can be fetched. Local-only hosts are outside what this check can see.
What should I do after a weak result?
Add the headers for your server or framework from the guide, deploy, then run the same URL again to confirm X-Frame-Options and frame-ancestors are present.
Related tools
More Security & Privacy tools.
AES Cipher
Encrypt and decrypt using AES
Bcrypt Hash Generator
Generate secure BCrypt password hashes
Blowfish Cipher
Fast symmetric block cipher encryption with variable-length keys (32-448 bits)
CSP Generator
Generate Content Security Policy headers
CSRF Token Generator
Generate secure CSRF protection tokens
DES Cipher
DES and Triple DES encryption/decryption for legacy system compatibility
Hash Calculator
Calculate MD5 SHA hashes quickly
HMAC Generator
Generate HMAC authentication message codes
Built by Infyways
Need more than a tool.
These utilities are made by the Infyways studio. When a free tool is not enough, we build the real thing.