开发者

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 chrom开发者_开发问答e extension, as like this:

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

Thanks


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. :-)


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜