Skip to content

Instantly share code, notes, and snippets.

@breisa
Created March 22, 2026 19:10
Show Gist options
  • Select an option

  • Save breisa/bd12cfa9f2c9cea8318607361a796310 to your computer and use it in GitHub Desktop.

Select an option

Save breisa/bd12cfa9f2c9cea8318607361a796310 to your computer and use it in GitHub Desktop.
how to customize firefox ai sidebar

How to customize Firefox AI sidebar

Firefox AI sidebar is just an additional tab that opens some AI provider's website with a prompt passed via the q=PROMPT URL parameter. The prompt is built from a prefix that gives the AI relevant context and a command prompt that is appended afterwards. The command prompt is either entered by the user via the UI or predefined depending on the selected menu item (e.g. 'summarize' -> some summarization prompt). All of this can be configured in about:config.

AI Provider

Firefox comes preconfigured with a selection of major providers. You can also configure a local or custom provider. First set browser.ml.chat.hideLocalhost to false. Then set browser.ml.chat.provider to the URL of your custom AI provider e.g. your local llama.cpp server's web interface or some other provider. For example, to use DuckDuckGo's duck.ai chat, you could use https://www.duckduckgo.com/?&ia=chat&bang=true.

Prompts

The available prompts/commands are stored in keys like browser.ml.chat.prompts.0-browser.ml.chat.prompts.N. The default prompts are also defined in this way, but their localized text is loaded from the language pack (e.g. the German prompts). You can add new prompts by creating new keys of the same form e.g., browser.ml.chat.prompts.7 with JSON content that specifies the prompt name and text:

{"id":"mytranslate","label":"Translate","value":"Translate the text between <selection></selection> tags. Default target language: English. If the source text is English, translate to German. Preserve meaning exactly; do not add or remove information. Return only the translated text (no explanations or extra formatting)."}

You can modify the default prompts by replacing their default JSON value (which points to the localized prompt) with the structure above.

Prefix

The inserted prefix can be modified by setting browser.ml.chat.prompt.prefix to the desired prompt text. It is possible to insert the current tab's title, URL, and the selected/full text into the prompt using the following syntax:

Title: %tabTitle% Selection: %selection% URL: %url%

Each of these placeholders is replaced with XML tags that contain the content, for example <selection>selected text</selection>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment