在openDialog()中是否可以使用相对URL /路径?

问题描述 投票:1回答:1

URL是否可以使用相对路径?

[changelog.htmoptions.xul在同一目录中

options.xul的部分

  <setting title="&options.changelog.title;" type="control">
    <button label="&options.changelog.label;" 
      oncommand="openDialog('chrome://myAddon/content/changelog.htm', '',
      'dialog=no, modal=no, resizable=yes, width=500, height=600');"/>
  </setting>

有其他选择吗?

更新:如果尝试以下操作,则会收到错误“控制台中的[NS_ERROR_MALFORMED_URI:"]

  <setting title="&options.changelog.title;" type="control">
    <button label="&options.changelog.label;" 
      oncommand="openDialog('changelog.htm', '',
      'dialog=no, modal=no, resizable=yes, width=500, height=600');"/>
  </setting>

Update2:我应该提到我的测试是在<em:optionsType>2</em:optionsType>上进行的,并且如以下答案所述,它似乎不起作用。

javascript firefox firefox-addon firefox-addon-restartless
1个回答
3
投票
<button label="test" oncommand="openDialog('test.xul', '', 'dialog=no, modal=no, resizable=yes, width=500, height=600');"/>
© www.soinside.com 2019 - 2024. All rights reserved.