An inner frame that works much like the HTML iframe element. The src attribute can be used to specify the content of the frame. This content is a separate document. The children of the iframe are ignored.
Currently, XUL iframes running in remote processes are not supported. If you want to run content in a remote process, use a XUL browser element.
Warning: When used in chrome-privileged documents (either HTML or XUL) such as Firefox addons, the contents of the frame may have the same permissions as Firefox itself. This can be a serious security vulnerability, for example if you use src="http://...". When used in this case, please see Displaying web content in an extension without security issues.
More information is available in the XUL tutorial.
- Attributes
- showcaret, src, type, transparent
- Properties
- accessibleType, contentDocument, contentWindow, docShell, webNavigation
Examples
<iframe src="table.php" flex="2" id="browserTable" name="table_frame"/>
Selecting an URL from a menu
<menulist oncommand="doNav(this);">
  <menupopup>
    <menuitem label="Mozilla" value="http://mozilla.org" />
    <menuitem label="Slashdot" value="http://slashdot.org"/>
    <menuitem label="Sourceforge" value="http://sf.net" />
    <menuitem label="Freshmeat" value="http://freshmeat.net"/>
  </menupopup>
</menulist>
<iframe id="myFrame" flex="1"/>
<script>
function doNav(obj) {
  var url = obj.selectedItem.value;
  // note the firstChild is the menupopup element
  document.getElementById('myFrame').setAttribute('src', url);
}
</script>
Attributes
-  showcaret
- Type: boolean
-  Whether or not to cause a typing caret to be visible in the content area. Default is false.
- 
    src
- Type: URI
- The URI of the content to appear in the element.
- type
- Type: one of the values below
- The type of browser, which can be used to set the access of the document loaded inside the browser. If this is not set, the loaded document has the same access as the window containing the browser
-  Warning: The type attribute must be set before the element is inserted into the document.
-  - content
- A browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it.
- content-primary
- The primary browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it. For instance, in a web browser, this would be the element that displays the web page. The window for the primary content can be retrieved more conveniently using window.content.
- content-targetable
- One browser among many for content. The content that is loaded inside the browser is not allowed to access the chrome above it. This is the preferred value for any browser
- chrome
- (default behaviour): A browser, intended to be used for loading privileged content using a chrome:// URI. Don't use for content from web, as this may cause serious security problems!
 
- transparent
- Type: one of the values below
- Set the background of an iframe
- transparent
- This results in the iframe's background being transparent. This can be used to workaround things like bug 540911
 
| Inherited from XUL element | 
Properties
- 
    accessibleType
- Type: integer
- A value indicating the type of accessibility object for the element.
- 
    contentDocument
- Type: document
- This read-only property contains the document object in the element.
- contentWindow
- Type: TODO
- Use the contentWindow.wrappedJSObject to obtain a DOM(html) window object
- 
    docShell
- 
    Type: nsIDocShell
- 
    This read-only property contains the nsIDocShellobject for the document.