2011-05-08 74 views

回答

2

这里是一个叠加的方法。

文章:Creating toolbar button @ MDC

XUL弹出的对话框可以在铬指notification-popupidentity-popup(建议)://browser/content/browser.xul

和iframe在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> 

对于听众工具栏按钮(的onclick,onkeypress事件),请指gIdentityHandler . handleIdentityButtonEvent铬://browser/content/browser.js


如果你的插件是一个自举请参阅Oxymoronical的Playing with windows in restartless (bootstrapped) extensions

需要Javascript DOM控制技术。

引用XUL示例,并简单地通过document.createElement方法或者甚至通过document.createElementNS(XULNS, "(tag name)")方法创建元素,其中const XULNS = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';已被写入。


随意问更多,并成为我们的注册用户之一。 :-)

0

你的问题是与创建iframe?或创建iframe内容? (例如,你不能将src属性设置为不是你想要显示iframe的页面的域的文件)