how to show a preference page using mozilla Add-on SDK?

前提是你 提交于 2019-12-22 12:19:34

问题


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!


回答1:


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!



来源:https://stackoverflow.com/questions/26410184/how-to-show-a-preference-page-using-mozilla-add-on-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!