views:

915

answers:

2

I am trying to update a custom firefox extension that I created for some tasks at work. Basically it is a sidebar that pulls up one of our webpages in an iframe for various purposes. When moving to Firefox 3 the iframe won't appear at all.

Below is an example of the XUL files that contains extension specific code including iframe, currently with just an attempt to load google but it it won't work with anything. I can't find any mention online of changes in FF3 that would cause this. Any suggestions would be appreciated.

<?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"&gt;
  <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>

Here is the overlay XUL file

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

    <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>
+1  A: 

I would try setting flex="1" on the iframe. If that's not working, perhaps try it with the browser element instead of iframe.

Zach
+2  A: 
  1. Set flex="1" on the iframe
  2. The XUL code for sidebar is not an overlay, it's a document loaded inside an iframe (look at the Firefox main window in the DOM inspector). So the root element should be <page>, not <overlay>. This, combined with the flex="1", should make the page display.
  3. You usually want to put type="content" or type="content-primary" on the iframe. Definitely so if you load untrusted pages in it.
Nickolay
The change from "overlay" to "page" corrected the problem. I noticed in version control that I had flex="1" there in the past but must have removed it during troubleshooting, but that simply caused sizing of the element to be off. THANKS!
Dan Roberts