2008-10-03 77 views
2

我正在嘗試更新我爲某些工作創建的自定義Firefox擴展。基本上它是一個側欄,用於各種目的,在iframe中提供我們的一個網頁。當移動到Firefox 3時,iframe不會出現。如何使用IFRAME更新Firefox 2兼容擴展到Firefox 3?

下面是包含擴展特定代碼(包括iframe)的XUL文件示例,目前只是試圖加載谷歌,但它不會與任何東西一起工作。我無法在網上找到任何可能導致此問題的FF3更改。任何建議,將不勝感激。

<?xml version="1.0"?> 
<?xml-stylesheet href="chrome://customsidebar/skin/customsidebar.css" type="text/css"?> 

<overlay id="customsidebar-Main" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 
    <script type="application/x-javascript" src="chrome://customsidebar/content/customsidebar.js"/> 

    <vbox flex="1"> 
    <toolbar> 
     <vbox> 
     <hbox id="customsidebar_TopToolbarRow"> 
      <toolbarbutton label="Refresh" id="customsidebar_Refresh" oncommand="customsidebar_Refresh()" /> 
     </hbox> 
     <hbox> 
      <label control="customsidebar_StatusBox" value="Log"/> 
      <textbox id="customsidebar_StatusBox" multiline="true" rows="1" wrap="off" /> 
     </hbox> 
     </vbox> 
    </toolbar> 

    <iframe id="customsidebar_Iframe" src="http://www.google.com" /> 
    </vbox> 
</overlay> 

這裏是覆蓋XUL文件

<?xml version="1.0"?> 
<overlay id="CustomSidebar-Overlay" 
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 

    <menupopup id="viewSidebarMenu"> 
     <menuitem observes="viewCustomSidebar" /> 
    </menupopup> 

    <broadcasterset id="mainBroadcasterSet"> 
    <broadcaster id="viewCustomSidebar" 
     autoCheck="false" 
     label="CustomSidebar" 
     type="checkbox" group="sidebar" 
     sidebarurl="chrome://customersidebar/content/customersidebarMain.xul" 
     sidebartitle="CustomSidebar" 
     oncommand="toggleSidebar('viewCustomSidebar');"/> 
    </broadcasterset> 

</overlay> 

回答

2
  1. 設置flex =「1」上的iframe
  2. 的側邊欄的XUL代碼不是覆蓋,這是一個IFRAME(看在DOM檢查Firefox的主窗口)中加載的文件。所以根元素應該是<頁面>,而不是<疊加>。這與flex =「1」結合,應該使頁面顯示。
  3. 您通常要在iframe上放置type =「content」或type =「content-primary」。絕對如此,如果你加載不信任的頁面。
+0

從「疊加」更改爲「頁面」更正了問題。我注意到在版本控制中,過去我的flex =「1」,但在故障排除期間必須將其刪除,但這只是導致元素大小關閉。謝謝! – 2008-10-03 21:07:57

1

我會嘗試設置柔性= 「1」 上的iframe。如果這不起作用,可以嘗試使用browser而不是iframe。