Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Creating an iframe in Firefox extension code
if (Components && Components.classes) {
// This means we are in a Firefox extension.
var appShell = Components.classes[";1"]
// hiddenDoc will now point to a regular DOM document.
var hiddenDoc = appShell.hiddenDOMWindow.document;
// Create an iframe.
let iframe = hiddenDoc.createElementNS("", "iframe");
iframe.setAttribute("mozframetype", "content");
// Load a page in it.
iframe.setAttribute("src", "");

This comment has been minimized.

Copy link

gokul01it commented Apr 21, 2015

Could you please answer me the below queries?

How use this js file in webpages?
How to create extension out of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.