如何使用mozilla附加SDK显示首选项页面? [英] how to show a preference page using mozilla Add-on SDK?
问题描述
simple-prefs
太简单了,不能用作其支持的数据类型如此有限。
在一个XUL应用程序中,我可以使用下面的代码:
< EM:optionsType→3< / EM:optionsType>
< em:optionsURL> chrome://myaddon/content/options.html< / em:optionsURL>
设置我的首选项页面。
我发现
XUL迁移指南
其中说:
这只是作为一个迁移的辅助工具,它是一个不错的主意,将XUL窗口HTML。
我怎样才能制作一个HTML首选项页面?
非常感谢!
使用 simple-prefs
,首选项的类型设置为 control
。在其单击事件中,使用tab模块打开一个页面,然后使用 simple-storage
来存储数据。
就是这样!
I am developing an extension using the Addon-SDK. I want to show a preference page in order to get some users' configuration.
simple-prefs
is too simple to use as its supported data type is so limited.
In a XUL app, I can use the following
<em:optionsType>3</em:optionsType>
<em:optionsURL>chrome://myaddon/content/options.html</em:optionsURL>
to set my preference page.
I found the XUL migration guide which says:
This is provided only as a migration aid, and it's still a good idea to port XUL windows to HTML.
How then can I make an HTML preference page ?
Many thanks!
I solved it in the following way:
Use simple-prefs
with the preference type set to control
. On its click event, open a page using the tab module, then use simple-storage
to store data.
That's it!
这篇关于如何使用mozilla附加SDK显示首选项页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!