我正在尝试更新我为某些工作任务创建的自定义firefox扩展。基本上它是一个侧边栏,用于各种目的,在iframe中提取我们的一个网页。移动到Firefox 3时,iframe根本不会出现。

下面是一个包含扩展程序特定代码的XUL文件示例,其中包括iframe,目前只是尝试加载谷歌,但它不能用于任何事情。我在网上找不到任何会引起这种情况的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>
有帮助吗?

解决方案

  1. 设置flex = <!>“1 <!>”;关于iframe
  2. 侧边栏的XUL代码不是叠加层,它是在iframe中加载的文档(查看DOM检查器中的Firefox主窗口)。所以根元素应该是<!> lt; page <!> gt;,而不是<!> lt; overlay <!> gt;。这与flex = <!>“1 <!>”相结合,应该使页面显示。
  3. 您通常想要输入type = <!> quot; content <!> quot;或者type = <!> quot; content-primary <!> quot;在iframe上。如果您在其中加载不受信任的页面,那肯定是这样。

其他提示

我会尝试设置flex = <!>“1 <!>”;在iframe上。如果这不起作用,也许可以使用浏览器元素而不是iframe来尝试。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top