Easy inline options library for WebExtensions

Talk about add-ons and extension development.
Post Reply
AlexVallat
Posts: 90
Joined: September 30th, 2006, 8:53 am

Easy inline options library for WebExtensions

Post by AlexVallat »

It's been frustrating to me that there's no equivalent for WebExtensions of the old Inline Options that was available to legacy addons. With the old options.xul system it would handle the reading and writing of preferences, styling to match the browser UI, and consistency of controls.

To that end, I've started a project: https://github.com/AlexVallat/FirefoxInlineOptions to provide a similar service to WebExtensions. Instead of writing an HTML page from scratch and wiring it up to browser.storage.local, you can simply declaratively state your settings in a js object, and have them shown in a similar style to the old Inline Options UI:

Code: Select all

const optionsConfig = [ {
        key: "1",
        title: "Boolean no description",
        type: "boolean",},
    {   key: "2",
        title: "Boolean with a description",
        type: "boolean",
        description: "A description",},
    {   key: "3",
        title: "Integer",
        type: "integer",
        description: "A description",},
etc...
Image

I haven't added support for the old colour picker or file/directory picker controls that were available, but that could be done in the future if required. Pull requests welcome.
Post Reply