messengerSettings API

The messengerSettings API allows to access global messenger settings.

Property: messagePlainTextFlowedOutputEnabled

Whether long lines in outgoing plain text messages will get soft line breaks (​ \n) or hard line breaks (\n), to comply with requirements from RFC 2822. Soft line breaks will be ignored when displayed by the receiving client. When flowed output is enabled, add-ons should not create plain text messages with manually inserted hard or soft line breaks to achieve a certain text width, as that will most probably interfere with the default line break handling and generate ridged text. When flowed output is disabled, add-ons could add hard line breaks to have control over the final message, but any line longer than the maximum line length will still receive additional hard line breaks. See messageLineLengthLimit. This property is read-only.

Permissions

The following permissions influence the behavior of the API. Depending on which permissions are requested, additional methods might be available, or certain data may be included in responses.

Hint

Request permissions only when needed. Unnecessary requests may result in rejection during ATN review.

messengerSettings

messengerSettings

Read Thunderbird settings.

Note

The permission messengerSettings is required to use messenger.messengerSettings.messagePlainTextFlowedOutputEnabled.*.

Functions

clear(details)

Clears the setting, restoring any default value.

Parameters

details

details

(object)

Which setting to clear.

scope

[scope]

(SettingScope, optional)

Where to clear the setting (default: regular).

Required permissions

  • messengerSettings

get(details)

Gets the value of a setting.

Parameters

details

details

(object)

Which setting to consider.

incognito

[incognito]

(boolean, optional)

Whether to return the value that applies to the incognito session (default false).

Return type (Promise)

_returns

object

Details of the currently effective value.

levelOfControl

levelOfControl

The level of control of the setting.

value

value

(any)

The value of the setting.

incognitoSpecific

[incognitoSpecific]

(boolean, optional)

Whether the effective value is specific to the incognito session.<br/>This property will only be present if the incognito property in the details parameter of get() was true.

Required permissions

  • messengerSettings

set(details)

Sets the value of a setting.

Parameters

details

details

(object)

Which setting to change.

value

value

(any)

The value of the setting. <br/>Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type.

scope

[scope]

(SettingScope, optional)

Where to set the setting (default: regular).

Required permissions

  • messengerSettings

Events

onChange

Fired after the setting changes.

Parameters for onChange.addListener(listener)

listener(details)

listener(details)

A function that will be called when this event occurs.

Parameters passed to the listener function

details

details

(object)

levelOfControl

levelOfControl

The level of control of the setting.

value

value

(any)

The value of the setting after the change.

incognitoSpecific

[incognitoSpecific]

(boolean, optional)

Whether the value that has changed is specific to the incognito session.<br/>This property will only be present if the user has enabled the extension in incognito mode.

Required permissions

  • messengerSettings

Types

LevelOfControl

One of

  • not_controllable: cannot be controlled by any extension

  • controlled_by_other_extensions: controlled by extensions with higher precedence

  • controllable_by_this_extension: can be controlled by this extension

  • controlled_by_this_extension: controlled by this extension

string

Supported values:

controllable_by_this_extension

controllable_by_this_extension

controlled_by_other_extensions

controlled_by_other_extensions

controlled_by_this_extension

controlled_by_this_extension

not_controllable

not_controllable

SettingScope

The scope of the Setting. One of

  • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),

  • regular_only: setting for the regular profile only (not inherited by the incognito profile),

  • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),

  • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). Only regular is supported by Thunderbird at this time.

string

Supported values:

incognito_persistent

incognito_persistent

incognito_session_only

incognito_session_only

regular

regular

regular_only

regular_only