how to show a preference page using mozilla Add-on

2019-05-25 05:06发布

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条回答
2楼-- · 2019-05-25 05:30

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!

查看更多
登录 后发表回答