Protect your application
from hostile iframes.
Block rogue ads, popups, redirects, and unsafe third-party frames before they reach your users. A client-side security layer that neutralizes threats at the DOM boundary.
YouTube, Stripe, verified providers
Disarm popups & top-redirects
Detach from DOM / about:blank
Engineered for deterministic iframe control.
Pre-emptive Interception
Wraps DOM creation APIs before the browser initiates network requests, preventing malicious scripts from starting execution.
Mutation Monitoring
Continuous background MutationObserver inspection catches elements dynamically injected via innerHTML, React, or Vue.
Safe Sandboxing
Strictly omits allow-top-navigation and allow-popups, preventing embedded video player click hijacks and spam tabs.
Trusted Whitelist
Pre-calibrated support for YouTube, Vimeo, Stripe, PayPal, reCAPTCHA, and Cloudflare Turnstile without breaking user workflows.
Tracking Pixel Defense
Identifies and neutralizes hidden 0×0 and 1×1 surveillance frames and affiliate tracking scripts.
Security Telemetry
Comprehensive real-time reporting via getStats() and onBlocked() callbacks for telemetry streaming and audit logging.
Security at the DOM boundary
Unlike network firewalls or DNS ad-blockers, iframe-shield operates inside the client browsing context, evaluating every frame element as it enters the page lifecycle.
Boundary Interception
document.createElement('iframe') and Node.prototype.appendChild are wrapped synchronously.
Threat Classification
Source URL, hostname patterns, overlay opacity, and standard ad dimensions are evaluated.
Policy Enforcement
Safe sandbox flags are attached, neutralizing top-level navigation and unrequested popups.
Live Attack Simulator & Console
Drop-in security across frameworks.
<!-- Drop this into your <head> tag to protect the entire page -->
<script src="https://cdn.jsdelivr.net/npm/@jojin1709/iframe-shield/dist/iframe-shield.min.js"></script>