Mobile/Fennec/Extensions/Options: Difference between revisions

Jump to navigation Jump to search
Line 73: Line 73:
== Options XUL ==
== Options XUL ==


The XUL allowed for the Fennec options system is limited to a [http://mxr.mozilla.org/mobile-browser/source/chrome/content/bindings/setting.xml few new tags]. Here is an example of a Fennec options dialog:
The XUL allowed for the Fennec options system is limited to <code><setting></code> tags. Here is an example of a Fennec options dialog:
<pre>
<pre>
<?xml version="1.0"?>
<?xml version="1.0"?>
Line 92: Line 92:
</pre>
</pre>


Note that there isn't any <code><script></code> support and it's limited to <code><setting></code> tags. The root <code><vbox></code> just acts as a container, it isn't merged into the main window.
Note that there isn't any <code><script></code> support. The root <code><vbox></code> just acts as a container, it isn't merged into the main window.


If you use type="control" settings that aren't tied to preferences, then you will probably need to initialize them when they first appear.  You can't do this until your options XUL has been loaded into the browser window, so you should observe the <code>AddonManager.OPTIONS_NOTIFICATION_DISPLAYED</code> notification to initialize your settings.  For example:
If you use type="control" settings that aren't tied to preferences, then you will probably need to initialize them when they first appear.  You can't do this until your options XUL has been loaded into the browser window, so you should observe the <code>AddonManager.OPTIONS_NOTIFICATION_DISPLAYED</code> notification to initialize your settings.  For example:
Confirmed users
1,111

edits

Navigation menu