【发布时间】:2014-09-21 19:55:03
【问题描述】:
是否可以为 URL 使用相对路径?
changelog.htm与options.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:" in console
<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>
更新 2:
我应该提到我的测试是在<em:optionsType>2</em:optionsType> 上进行的,正如以下答案中所解释的,它似乎不起作用。
【问题讨论】:
-
我很确定你需要绝对定义它。
标签: javascript firefox firefox-addon firefox-addon-restartless