Firefox Source Docs Logo

Quick search

Overview

  • A Glossary of Common Terms
  • A Quick Guide to Mozilla Applications

Getting Started

  • Getting Set Up To Work On The Firefox Codebase

Working On Firefox

  • Working on Firefox
  • Bug Handling

Firefox User Guide

  • Firefox DevTools User Docs

Source Code Documentation

  • Governance
  • Firefox Front-end
    • How-To’s
    • Address Bar
    • Browser Usage Telemetry
    • Frontend Code Review Best Practices
    • Command Line Parameters
    • Browser Startup
    • Category manager indirection (callModulesFromCategory)
    • CustomizableUI Component
    • Enterprise Policies
    • Web Apps in Firefox
    • Form Autofill
    • Firefox Home (New Tab)
    • Firefox Welcome Experience (about:welcome)
    • Installer
    • Installation Attribution
    • Default Browser Agent
    • Migration
    • PageDataService
    • Places
    • Messaging System
      • Vision
      • What does Messaging System support?
      • Messaging System Overview
      • Message Routing
      • UI Templates
        • Moments Page
        • Feature Callout
        • Contextual Feature Recommendation
        • About Welcome
        • Infobars
        • Spotlight
        • PrivateBrowsing
        • Multi-Message
        • MenuMessage
      • Detailed Docs
    • Search UI
    • Tabbed Browser
    • Touch Bar
    • UITour
    • Firefox Branding
    • Storybook for Firefox
    • Reusable UI widgets
    • Other types of UI Widgets
    • Lit
    • XUL and HTML
    • Figma Code Connect
    • Design Tokens
    • Backup Component
    • Sidebar
    • moz-cached-ohttp Protocol
  • DOM
  • Editor
  • Style system (CSS) & Layout
  • Graphics
  • Processes, Threads and IPC
  • Firefox DevTools Contributor Docs
  • Toolkit
  • SpiderMonkey
  • JS Loader
  • GeckoView
  • Fenix
  • Focus for Android
  • WebIDL
  • libpref
  • Networking
  • Remote Protocols
  • Services
  • Permissions
  • File Handling
  • Firefox on macOS
  • Firefox on Windows
  • Firefox AI Runtime
  • Accessibility
  • Media Playback
  • Code quality
  • Writing Rust Code
  • Rust Components
  • Gecko Profiler
  • Performance
  • Database bindings (SQLite, KV, …)
  • XPCOM
  • NSPR
  • Network Security Services (NSS)
  • Web Security Checks in Gecko

The Firefox Build System

  • Mach
  • Pushing to Try
  • Build System
  • Firefox CI and Taskgraph
  • Managing Documentation
  • Vendoring Third Party Components

Testing & Test Infrastructure

  • Automated Testing
  • Understanding Treeherder Results
  • Sheriffed intermittent failures
  • Turning on Firefox tests for a new configuration
  • Avoiding intermittent tests
  • Debugging Intermittent Test Failures
  • Testing Policy
  • Configuration Changes
  • Browser chrome mochitests
  • Chrome Tests
  • Marionette
  • geckodriver
  • Test Verification
  • WebRender Tests
  • Mochitest
  • XPCShell tests
  • TPS
  • web-platform-tests
  • GTest
  • Fuzzing
  • Sanitizer
  • Performance Testing
  • Code coverage
  • Testing & Debugging Rust Code

AI Agent Tools

  • AI Agent Tools for Firefox Development

Releases & Updates

  • Mozilla Update Infrastructure
  • Watershed Updates
  • Desupport Updates
  • Update Verify

Localization & Internationalization

  • Internationalization
  • Localization

Firefox and Python

  • mozbase
  • Using third-party Python packages

Metrics Collected in Firefox

  • Metrics
Firefox Source Docs
  • Firefox Front-end
  • Messaging System
  • MenuMessage
  • Report an issue / View page source

MenuMessage

MenuMessage displays a contextual call-to-action card inside Firefox’s panel menus: the App Menu (hamburger) and the PXI Menu (Firefox Accounts avatar panel).

MenuMessage in the PXI Menu

Surfaces

Surface

testingTriggerContext

Supported messageType

App Menu

app_menu

fxa_cta, default_cta

PXI Menu

pxi_menu

fxa_cta only

Message Types

  • fxa_cta: Firefox Accounts sign-in prompt. Hidden for signed-in users unless allowWhenSignedIn: true. Available in both the App Menu and PXI Menu.

  • default_cta: General CTA. App Menu only. Always shown regardless of sign-in state.

Layouts

MenuMessage Column Bottom Layout

  • column (default): Illustration above text with a button stack below. Set imagePosition: "bottom" to render the illustration full-bleed at the bottom of the card instead. MenuMessage Row Layout

  • row: Text on the left, button and illustration on the right. MenuMessage Simple Layout

  • simple: Single row with primary text and button only — no image, secondary text or close button. MenuMessage Split Layout

  • split: Two-column layout (illustration and copy). Use imagePosition "start" or "end" to swap which side the illustration sits on and "bottom" to have it aligned block-end. Default is "end".

Testing Menu Messages

Previewing the layout options and configurations can be done through ./mach storybook or through about:asrouter, as seen below. See the MenuMessage Schema for the available configuration options.

Using ASRouter devtools:

  1. Set browser.newtabpage.activity-stream.asrouter.devtoolsEnabled to true in about:config

  2. Go to about:asrouter

  3. Select panel as the provider and find messages with "template": "menu_message"

  4. Click Show — the testingTriggerContext field on the message determines which menu surface is simulated (app_menu or fxa_cta).

  5. Paste custom JSON in the text area and click Modify to preview changes

Example JSON

{
    "id": "EXAMPLE_PXI_MENU_SPLIT_LAYOUT",
    "template": "menu_message",
    "content": {
        "layout": "split",
        "messageType": "fxa_cta",
        "primaryText": {
            "string_id": "fxa-menu-message-sync-devices-primary-text"
        },
        "secondaryText": {
            "string_id": "fxa-menu-message-sync-devices-secondary-text2"
        },
        "primaryActionText": {
            "string_id": "fxa-menu-message-sign-in-button"
        },
        "imageURL": "chrome://browser/content/asrouter/assets/kit-peek.svg",
        "imageVerticalBottomOffset": -8,
        "imagePosition": "bottom",
        "imageWidth": 95,
        "primaryAction": {
            "type": "FXA_SIGNIN_FLOW",
            "data": {
                "where": "tab",
                "autoClose": false
            }
        },
        "closeAction": {
            "type": "BLOCK_MESSAGE",
            "data": {
                "id": "EXAMPLE_PXI_MENU_SPLIT_LAYOUT"
            }
        }
    },
    "trigger": {
        "id": "menuOpened"
    },
    "testingTriggerContext": "pxi_menu",
    "groups": [],
}

Schema

MenuMessage.schema.json

Related Docs

  • Targeting attributes

  • Triggers

  • Special Message Actions

Previous Next

Built with Sphinx using a theme provided by Read the Docs.