Windows 中未记录 Firefox 扩展首选项
我有一个简单的 Firefox 扩展首选项窗格,如下所示:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<prefwindow title="Preferences"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<preferences>
<preference id="extensions.autofc.signalSuccess" name="extensions.autofc.signalSuccess" type="bool"/>
<preference id="extensions.autofc.dpair" name="extensions.autofc.dpair" type="string"/>
</preferences>
<prefpane label="Preferences">
<checkbox preference="extensions.autofc.signalSuccess" label="Tell me if everything is okay"/>
<label value="NOTE: Errors are always alerted"/>
<html:hr />
<hbox align="center">
<label value="Pair Options" />
<groupbox>
<radiogroup preference="extensions.autofc.dpair">
<radio label="Pair 1" value="ee"/>
<radio label="Pair 2" value="ev"/>
</radiogroup>
</groupbox>
</hbox>
</prefpane>
</prefwindow>
这在 Linux 上完美运行,这意味着用户可以勾选或取消勾选复选框或选择单选按钮,单击“确定”,再次打开首选项时,将保存最新的选择。
令我惊讶的是,当在 Windows 上进行测试时,选择不会保存,即,当再次打开首选项窗格时,选择会返回到默认值。
我猜想的一件事是,此首选项窗格中的选择是由 Firefox 处理的,但我可能是错的。
你们知道为什么这在 Windows 上不起作用吗?特别是,它不适用于 Windows 7 上的 FF 3.6.1、FF 8、FF 7.0.1。
I'm having a simple preference pane for Firefox Extension as follows:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<prefwindow title="Preferences"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<preferences>
<preference id="extensions.autofc.signalSuccess" name="extensions.autofc.signalSuccess" type="bool"/>
<preference id="extensions.autofc.dpair" name="extensions.autofc.dpair" type="string"/>
</preferences>
<prefpane label="Preferences">
<checkbox preference="extensions.autofc.signalSuccess" label="Tell me if everything is okay"/>
<label value="NOTE: Errors are always alerted"/>
<html:hr />
<hbox align="center">
<label value="Pair Options" />
<groupbox>
<radiogroup preference="extensions.autofc.dpair">
<radio label="Pair 1" value="ee"/>
<radio label="Pair 2" value="ev"/>
</radiogroup>
</groupbox>
</hbox>
</prefpane>
</prefwindow>
This works perfectly on Linux, meaning users can tick or untick the checkbox or select radio buttons, click Okay and when the Preference is opened again, the latest selections are saved.
What amazed me was that when this was tested on Windows, the selections are not saved, i.e., when opening Preference Pane again, the selections return to the default values.
One thing I've supposed was that the selections in this preference Pane are handled by Firefox but I may be wrong.
Do you guys have any insights on why this doesn't work on Windows. In particular, it didn't work on FF 3.6.1, FF 8, FF 7.0.1 on Windows 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该将
放在
内,而不是
内。You should place
<preferences>
inside<prefpane>
, not<prefwindow>
.