Based on https://wiki.mozilla.org/Mobile/Fennec/Extensions/Options, I
have the basics set up, but these don't exactly match my needs. What I
really need is a boolean-type setting where JS code is executed
depending on the user's setting.
The part that confuses me is that the Wiki page says
"The XUL allowed for the Fennec options system is limited to a few new
tags ... Note that there isn't any <script> support ..."
but the example includes
<button label="Clear" oncommand="MyAddon.clearLogs();"/>
If there's no script support, how is the MyAddon object declared and
instantiated?
Thanks,
Matthew
mozilla.dev.platforms.mobile
> The part that confuses me is that the Wiki page says
>
> "The XUL allowed for the Fennec options system is limited to a few new
> tags ... Note that there isn't any <script> support ..."
This means you can't include script in the options XUL file itself.
You need to include the script implementation in your add-on itself.
> but the example includes
>
> <button label="Clear" oncommand="MyAddon.clearLogs();"/>
So, <button> is in a <setting type="control" ...> inside the options
XUL file. MyAddon.clearLogs() is a function in your add-on itself.
OK, thanks. So there needs to be a MyAddon object with a clearLogs
function visible in the scope of the settings element - what is that
scope? What should I overlay in order to declare a suitable MyAddon
object?
Matthew