How to put an iFrame into Confluence

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

An IFrame (Inline Frame) is an HTML document embedded inside another HTML document on a website. The IFrame HTML element is often used to insert content from another source, such as an advertisement, into a Web page.

Although an IFrame behaves like an inline image, it can be configured with its own scrollbar independent of the surrounding page's scrollbar.

Please note that some sites do not work in an iframe. These have cross scripting protection in their headers. For example, Google has

x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block

If these (or similar) are present in the response from the website, then you will not be able to display them in an iframe. Both Google and Facebook are two examples of this. Confluence also has protection to stop itself being display. Please see Confluence page does not display in an iframe for more information.


Solution

  1. Login as your Confluence Admin, go to manage add-ons
  2. Enable all the modules of the Confluence HTML Macros
  3. Insert the Include HTML Macro when you are creating/editing a page.
    1. Go To Insert More Content > Other macros
    2. Search for HTML macro
    3. Paste the following code inside the macro, replace http://www.atlassian.com/ with your target website

      Iframe
      <iframe src="http://www.atlassian.com/" noborder="0" width="830" height="800" scrolling="yes" seamless></iframe>
  4. Save the page

 

Alternatively there are plugins available that provide similar functionality that do not require the HTML macro and can provide a smaller attack surface and can provide increased security. Please note that Atlassian does not provide support for these plugins but can be used as an alternative if there are security concerns with the HTML macro.

Last modified on Nov 2, 2017

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.