问题
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