代码之家  ›  专栏  ›  技术社区  ›  RandomEngy

字符串捆绑包在Firefox 25中的工作方式不同?

  •  0
  • RandomEngy  · 技术社区  · 11 年前

    我收到了一些错误报告,说我的Firefox扩展在Firefox 25中不再工作。我无法重现错误,但有人把他们看到的错误发给了我:

    类型错误:this.hostImageBundle.getString不是函数@chrome://rehostimage/content/rehostimage.js:196

    重新主持图像.js:

    this.rehostImageBundle = document.getElementById("us.engy.rehostImage.bundle");
    ...
    var stringValue = this.rehostImageBundle.getString("message.uploadprogress");
    

    它们在相同的功能、相同的范围内运行。最后一行是196行。

    重新托管.xul:

    <!DOCTYPE window SYSTEM "chrome://rehostimage/locale/rehostimage.ent">
    <overlay id="rehostimage" 
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
      <script type="application/x-javascript" src="chrome://rehostimage/content/rehostimage.js"/>
      ...
    
      <popup id="contentAreaContextMenu">
        <stringbundleset id="us.engy.rehostImage.stringbundles">
          <stringbundle id="us.engy.rehostImage.bundle" src="chrome://rehostimage/locale/rehostimage.properties"/>
        </stringbundleset>
        ...
      </popup>
      ...
    </overlay>
    

    因此,当它调用getElementById时,似乎不会出现 stringbundle ,但我不知道为什么它会这样做,或者为什么它只会在某些设置中发生。

    我检查过了 Add-on Compatibility for Firefox 25 但没有看到任何关于字符串束的信息。

    有人遇到过这个问题或有什么想法吗?

    1 回复  |  直到 11 年前
        1
  •  0
  •   RandomEngy    11 年前

    事实证明,这是与菜单编辑器的扩展冲突。Firefox 25改变了它与上下文菜单的交互方式,删除了我在上下文菜单覆盖中包含的资源包。我把捆绑包移到了加载项栏覆盖上,这就解决了冲突。