• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
paulkinlan

paulkinlan

iframe-csp

Public
Like
iframe-csp
Home
Code
4
backend
1
frontend
9
README.md
main.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
README.md

CSP iframe Demo

A simple demonstration of Content Security Policy (CSP) frame-src directive behavior with different configurations.

Test Pages

  1. Test 1 (/test1) - CSP: frame-src 'none'

    • Attempts to embed https://paul.kinlan.me (should be blocked)
  2. Test 2 (/test2) - CSP: frame-src 'self'

    • Embeds a same-origin page (should work)
    • Attempts to embed https://paul.kinlan.me (should be blocked)
  3. Test 3 (/test3) - CSP: frame-src 'self'

    • Embeds a same-origin page that contains an iframe to https://paul.kinlan.me
    • Attempts to embed https://paul.kinlan.me directly (should be blocked)

Structure

  • backend/index.ts - Main Hono server with CSP headers
  • frontend/ - Static HTML pages for each test
  • frontend/hello.html - Simple hello world page (no iframes)
  • frontend/hello-with-iframe.html - Hello world page with iframe to external site
  • frontend/hello-with-nested-srcdoc.html - Hello world page with srcdoc containing external iframe
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.