**English** | [Deutsch](./README.de.md) # Inline Comment A Thunderbird add-on for answering emails inline. When you reply to a message and start typing inside the quoted text, the add-on splits the quote at the caret and inserts your own text in between, set apart in colour and prefixed with a marker such as `[OH]:`. ```text > Could you send me the documents by Friday? [OH]: Yes, they will arrive tomorrow. > And please attach the invoice. ``` In HTML messages the marker and your text are coloured; in plain-text messages the marker alone sets your comment apart. > **Screenshots** of the compose window and the options page will be added here before the first > release on addons.thunderbird.net. ## At a glance | What | Where | | ----------- | ------------------------------------------------------------------------------------------------------------------ | | Source code | [git.hassio-muc.de/Oliver_Herb/inline-comment](https://git.hassio-muc.de/Oliver_Herb/inline-comment) | | Issues | [git.hassio-muc.de/Oliver_Herb/inline-comment/issues](https://git.hassio-muc.de/Oliver_Herb/inline-comment/issues) | | Add-on ID | `inline-comment@ih-engineering.de` | | Package | `dist/inline-comment-.xpi` (after `npm run build`) | | Languages | English, German (follows the language of Thunderbird) | | Changes | [CHANGELOG.md](./CHANGELOG.md) | | Licence | [MPL-2.0](./LICENSE) | ## Compatibility - **Thunderbird 128 or later** (Manifest V3 MailExtension, `strict_min_version` 128.0). - Also works in Betterbird, which is based on Thunderbird. - HTML and plain-text messages, including nested quotes. - No platform-specific code: the add-on is plain JavaScript, HTML and CSS. ## Installation ### From addons.thunderbird.net Once the add-on is listed on addons.thunderbird.net (ATN), install it from there: in Thunderbird open **Tools > Add-ons and Themes**, search for "Inline Comment" and click **Add to Thunderbird**. Updates are then installed automatically. The add-on is not listed yet. ### From a file 1. Get the file `inline-comment-.xpi`, either from the [releases page](https://git.hassio-muc.de/Oliver_Herb/inline-comment/releases) or by building it yourself (see [Development](#development)). 2. In Thunderbird open **Tools > Add-ons and Themes** (Add-ons Manager). 3. Click the **gear icon > Install Add-on From File…** and select the `.xpi` file. After the first installation the options page opens so you can check the marker. ### Temporarily, for testing A temporary add-on stays loaded until Thunderbird is restarted. 1. Open **Tools > Developer Tools > Debug Add-ons** (`about:debugging`) and select **This Thunderbird**. 2. Click **Load Temporary Add-on…** and select the `.xpi` file, or `src/manifest.json` from a checkout of this repository. 3. After a change, click **Reload** next to the add-on. ### Removing In **Tools > Add-ons and Themes**, disable or remove "Inline Comment". Messages you have already sent keep their formatting. ## Usage - **Type inside a quote:** reply to a message, click into the quoted text where you want to answer and start typing. The quote is split at the caret, and the marker and your text appear between the two parts. - **Keep typing:** you can continue your comment, also over several lines with Enter. No new marker is added as long as the caret stays inside your own comment. - **Enter inside a quote, then type:** pressing Enter inside a quote splits it with an empty line. As soon as you type on that empty line, it gets the marker (HTML messages). - **Replace quoted text:** select part of the quote and type. The selection is deleted and your comment takes its place. - **Nothing happens by accident:** clicking, selecting, copying and moving the caret inside a quote change nothing. Only a typed character starts a comment. - **Toolbar button:** the **Inline Comment** button in the compose window turns the add-on on or off for this message. Its badge shows **on** or **off**. Whether new messages start with the add-on on is set in the options ("Active automatically in new emails"). - **Undo with Ctrl+Z** (Cmd+Z on macOS): undoes the comment and the split. With the default split mode ("by the editor") the split is a separate step, so press it once more after your comment is gone. ## Settings Open **Tools > Add-ons and Themes > Inline Comment > Options**. Changes are saved automatically and apply to open compose windows right away. ### Profiles per identity By default, one set of settings applies to all identities ("All identities (default)"). Select an identity and tick **Own settings for this identity** to give it its own marker and colours, for example a different marker for a work address. An identity without its own settings uses the settings for all identities. ### Marker template The marker is built from a template. The default is `[{initials}]:`, which gives for example `[OH]:`. Use the buttons below the field to insert a placeholder: | Placeholder | Replaced with | | ------------ | -------------------------------------------------------------------------------------------------------------------------- | | `{initials}` | Initials of the identity's display name ("Jane Doe" and "Doe, Jane" give `JD`); taken from the address if there is no name | | `{name}` | Display name of the sending identity (the address if there is no name) | | `{email}` | Email address of the sending identity | | `{date}` | Current date in the format of Thunderbird's language | | `{time}` | Current time (hours and minutes) | Unknown placeholders stay as they are. Examples: `{initials}:`, `[{name}]`, `--- {initials} {date} {time}:`. ### Appearance and spacing - **Colours:** marker colour and text colour, each with **bold** and **italic**; optionally a **highlight** with its own background colour. - **Spacing:** a blank line before and/or after the comment. - **Preview:** shows a sample reply with the current settings. The comment is formatted with inline CSS only, so the colours also survive in other mail programs that strip style sheets. ### Advanced - **Split the quote:** - **by the editor (Ctrl+Z works)** (default): the mail editor splits the quote, as when you press Enter inside a quote. The split can be undone. If the editor does not split the quote, the add-on splits it itself, as in the fallback mode. - **by the add-on (fallback)**: the add-on always splits the quote itself. Use this only if the default does not work in your setup; this split cannot be undone with Ctrl+Z. - **Diagnostic output in the error console:** writes detailed messages to the error console (**Tools > Developer Tools > Error Console**, Ctrl+Shift+J). Useful for bug reports. - **Reset to defaults** resets the profile that is shown (click twice to confirm). ## Privacy - The add-on **collects no data and transmits nothing**. It makes no network requests and contains no analytics or tracking. - Settings are stored locally in your Thunderbird profile (`storage.local`). The on/off state of each compose window is kept in `storage.session` and discarded when the window is closed. - The **name and email address of your identities** are read only to render the marker and to list the identities on the options page. They are not stored; a profile per identity is saved under the identity's internal ID. - In the compose window the add-on only looks at the editor around the caret to find the quote. The message content is not stored or sent anywhere. Permissions requested in `src/manifest.json`: | Permission | Used for | | -------------- | --------------------------------------------------------------------- | | `compose` | Reading compose window details (identity, HTML or plain text) | | `scripting` | Loading the compose script into compose windows | | `storage` | Saving the settings and the on/off state per compose window | | `accountsRead` | Reading identity name and address for the marker and the options page | ## Limitations - **Paste:** pasting from the clipboard inside a quote does not split the quote; the pasted text ends up inside the quote. - **IME composition:** text entered through an input method editor (for example Chinese, Japanese or Korean input) does not split the quote. - **Plain-text messages:** the empty line after pressing Enter inside a quote is not detected (it gets no marker), and the setting "Blank line after the comment" has no effect. - **Split by the add-on:** a split made by the add-on itself (fallback mode, or when the editor does not split the quote) cannot be undone with Ctrl+Z. - **Recipients** who read plain text only see the marker, not the colours. ## Development Requirements: Node.js 22 or later, `bash` and `zip` for the build. ```bash npm install # development tools only (Prettier, ESLint, jsdom); no runtime dependencies npm test # unit and DOM tests (node:test + jsdom) npm run lint # ESLint with JSDoc rules npm run check # format check + lint + tests, run before every push npm run build # check + dist/inline-comment-.xpi (includes LICENSE) ``` - Workflow, debugging in Thunderbird and releasing a new version: [.docs/guides/development.md](./.docs/guides/development.md) - Manual test in the real editor: [.docs/guides/testplan.md](./.docs/guides/testplan.md) - Architecture: [.docs/architecture/overview.md](./.docs/architecture/overview.md) Every change that goes into the `.xpi` needs an entry in [CHANGELOG.md](./CHANGELOG.md) and a new version in `package.json` **and** `src/manifest.json`; a test checks that all three match. ## Where to change what | Topic | File | | ------------------------------------------- | ---------------------------------------------------------------- | | Default settings, validation, profiles | `src/lib/settings.js` | | Marker template, initials, comment block | `src/lib/marker.js` | | Quote detection, splitting, caret | `src/lib/quote.js` | | Applying translations to the options page | `src/lib/i18n.js` | | User interface texts (English, German) | `src/_locales/en/messages.json`, `src/_locales/de/messages.json` | | Keyboard handling in the compose window | `src/compose/compose.js` | | Toolbar button, on/off state, configuration | `src/background.js` | | Options page | `src/options/` | | Permissions, version | `src/manifest.json` (+ `package.json`, `CHANGELOG.md`) | | Packaging the `.xpi` | `scripts/build.sh` | | Tests | `test/` | ## Contributing Bug reports and ideas are welcome as [issues](https://git.hassio-muc.de/Oliver_Herb/inline-comment/issues). For a bug, please include the Thunderbird (or Betterbird) version, your operating system, whether the message is HTML or plain text, the steps to reproduce and, if possible, the output from the error console with "Diagnostic output" turned on. Issues may be written in English or German. For changes to the code: write code, comments and commit messages in English, add tests for new functions, document every function with JSDoc (`npm run lint` checks it), start every new source file with the MPL-2.0 licence header (`test/license.test.js` checks it), run `npm run check` and add a `CHANGELOG.md` entry. A new language needs only a `src/_locales//messages.json` with the same keys as the English one. Contributions are accepted under the MPL-2.0. All project rules are listed in [CONTRIBUTING.md](./CONTRIBUTING.md). ## Development note Parts of this add-on, in particular the documentation and bug fixes, were created with the help of the AI assistant Claude (Anthropic). Idea, requirements and testing: Oliver Herb. ## Licence Copyright 2026 Oliver Herb. Licensed under the Mozilla Public License 2.0 (MPL-2.0), see [LICENSE](./LICENSE). You may use, modify and redistribute this add-on, also as a fork, as long as you keep the copyright and licence notices in every file (MPL-2.0 §3.4) and keep modified MPL files under the MPL with their source available. MPL-2.0 grants no trademark rights (§2.3): please give forks a different name and their own add-on ID. Not affiliated with or endorsed by Mozilla, MZLA Technologies or the Betterbird project. Thunderbird is a trademark of the Mozilla Foundation.