erez
erez

Reputation: 1

Firefox add-on to display iFrame

I'm trying to create firefox addon which will add an icon near the address bar, and when the user will click it, it will show an iframe which I'll set. Something similiar to chrome extension, as like this:

http://code.google.com/chrome/extensions/images/hello-world.png

Thanks

Upvotes: 0

Views: 1424

Answers (2)

Nimrod Yonatan Ben-Nes
Nimrod Yonatan Ben-Nes

Reputation: 386

Your problem is with the creation of the iframe? or with creating the iframe content? (for instance u can't set a src attribute to a file which is not the domain of the page where u want to display the iframe)

Upvotes: 0

tytsim
tytsim

Reputation: 139

Here is an overlaying method.

Article : Creating toolbar button @ MDC

XUL of popup box can refer to notification-popup and identity-popup(suggested) at chrome://browser/content/browser.xul

And iframe is avaiable in XUL.

<panel id="sth-popup" type="arrow" hidden="true" noautofocus="true" onpopupshown="(initial action)" level="top">
    <iframe id="sth-body" src="chrome://(extenstion name)/(sth html)" flex="1"/>
</panel>

For the listeners (onclick, onkeypress) of toolbar button , please refers to gIdentityHandler . handleIdentityButtonEventat chrome://browser/content/browser.js


If your addon is a bootstrapped extension, please refers to Playing with windows in restartless (bootstrapped) extensions at Oxymoronical.

Javascript DOM control technique is required.

Refers to the XUL example and create the elements simply by document.createElement method or even bydocument.createElementNS(XULNS, "(tag name)") method, whereconst XULNS = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'; had been written.


Feel free to ask more and to be one of our registered users. :-)

Upvotes: 2

Related Questions