Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fennec settings elements

4 views
Skip to first unread message

Matthew Wilson

unread,
Nov 15, 2009, 11:29:08 AM11/15/09
to
I'm looking at enhancing my extension for Fennec compatibility.
(Please let me know if there's a better newsgroup for this.)

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

Mark Finkle

unread,
Nov 16, 2009, 9:18:55 AM11/16/09
to
On Nov 15, 11:29 am, Matthew Wilson <matt...@mjwilson.demon.co.uk>
wrote:

> I'm looking at enhancing my extension for Fennec compatibility.
> (Please let me know if there's a better newsgroup for this.)

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.

Matthew Wilson

unread,
Nov 16, 2009, 1:22:23 PM11/16/09
to

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

0 new messages