encyclopegia.org

Framekiller

A framekiller (or framebuster or framebreaker) is a technique used by websites and web applications to prevent their web pages from being displayed within an HTML frame element.[src] A frame is a subdivision of a Web browser window and can act like a smaller window.[src] A framekiller is usually used to prevent a website from being loaded from within a frameset without permission, which might be part of an attack, as with clickjacking.[src] Framekiller scripts have largely been replaced by the usage of X-Frame-Options and Content-Security-Policy headers, which prevent the page from being loaded in a frame in the first place.[src] These headers are supported by all modern browsers and do not require the use of JavaScript.[src] These headers are also intended to be specified inside the web server software, rather than directly inside the HTML.[src]

A framekiller (or framebuster or framebreaker) is a technique used by websites and web applications to prevent their web pages from being displayed within an HTML frame element.[src] A frame is a subdivision of a Web browser window and can act like a smaller window.[src] A framekiller is usually used to prevent a website from being loaded from within a frameset without permission, which might be part of an attack, as with clickjacking.[src] Framekiller scripts have largely been replaced by the usage of X-Frame-Options and Content-Security-Policy headers, which prevent the page from being loaded in a frame in the first place.[src] These headers are supported by all modern browsers and do not require the use of JavaScript.[src] These headers are also intended to be specified inside the web server software, rather than directly inside the HTML.[src] ==Implementations== Framekillers are implemented using JavaScript that validates if the current window is the main window.[src] The recommended approach is to block rendering of the window by default and only unblock it after confirming the current window is the main one: html {display: none;} if (self == top) { document.documentElement.style.display = 'block'; } else { top.location = self.location; } This approach was proposed in 2010 by Gustav Rydstedt, Elie Bursztein, Dan Boneh and Collin Jackson in a paper that highlighted the limitations of existing frame-busting techniques along with techniques allowing to bypass them.[src] var framekiller = false; window.onbeforeunload = function() { if (framekiller) { return "..."; // any message that helps user to make decision } }; and the code below should be added after the frame tag: // "my_frame" should be changed according to the real id of the frame in your page document.getElementById("my_frame").onload = function() { framekiller = true; }; ===Original framekillers=== Historically, the first framekiller scripts were as simple as this: if (top != self) top.location.replace(location); The logic here was to display the page, but check if the top location is the same as the current page, and replace the top by current if not.[src] This method however can be easily bypassed by blocking execution of the framebuster script from the outer frame.[src] ==Framekiller limitations== Client-side JavaScript solution relies on the end-user's browser enforcing their own security.[src] This makes it a beneficial, but unreliable, means of disallowing your page to be embedded in other pages.[src] The following situations may render the script above useless: The user agent does not support JavaScript.[src] The user agent supports JavaScript but the user has turned support off.[src] The user agent's JavaScript support is flawed or partially implemented.[src] ==Anti-framekiller== The iframe in HTML5 has a attribute.[src] The attribute's value is a set of allowed capabilities for the iframe's content.[src] If the value is empty or not set, the iframe's content will not execute JavaScript, and won't allow top-level navigation.[src] By specifying in the space separated set of exceptions in the value, the iframe will allow JavaScript, but will still disallow top-level navigation, rendering framekillers in the iframe impotent.[src]

25 sentences · 25 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Framekiller." encyclopegia.org, 2026, https://encyclopegia.org/wiki/framekiller. Accessed 01 December 2026.

Chicago

"Framekiller." encyclopegia.org. Accessed December 1, 2026. https://encyclopegia.org/wiki/framekiller.

APA

encyclopegia.org. (2026). Framekiller. Retrieved December 1, 2026, from https://encyclopegia.org/wiki/framekiller

Accessed December 1, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1370380852 · 0.5 · snapshot enwiki-001370380852

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.