Har*_*anx 4 firefox firefox-addon firefox-addon-sdk
我正在尝试开发一个mozilla扩展.我只需要在弹出窗口中显示iframe,但不知道如何执行此操作.
我的要求是
我没有找到任何类似的教程.请帮我.
谢谢...
Hariprasad
在基于xul的扩展中,您可以这样做:
在你的xul文件中:
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="mainToolbarIcon"
image='chrome://yourExt/content/images/icon.png'
type="panel"
class="toolbarbutton-1 chromeclass-toolbar-additional">
<panel id="toolbarPanel"
type="arrow"
noautofocus="true"
consumeoutsideclicks="true"
noautohide="false"
onpopupshowing="handleOnLoad();"
level="parent">
<vbox id="iframeContainerContainer" align="top">
<iframe id="myframe" width="100" height="100"/>
</vbox>
</panel>
</toolbarbutton>
</toolbarpalette>
Run Code Online (Sandbox Code Playgroud)
在你的js文件中:
function handleOnLoad() {
var iframe = document.getElementById("myframe");
iframe.setAttribute("src","http://www.google.com");
}
Run Code Online (Sandbox Code Playgroud)
刚尝试了这个,它打开了一个带有谷歌iframe的面板:

| 归档时间: |
|
| 查看次数: |
3479 次 |
| 最近记录: |