# Extension Options Panel — Design - **Date:** 2026-07-29 - **Status:** Approved for planning - **Branch:** `feat/extension-options-panel` (cut from `develop` @ `5edb288`) ## Summary Add an options panel to the extension, reachable from `about:addons` → the extension's detail card → the **Options** tab (Windows) / **Preferences** tab (macOS, Linux). The panel configures two new entry points that this change also introduces: a context-menu item on selected text, and a keyboard shortcut that opens a fresh ChatGPT chat. The existing `gpt ` address-bar search provider is **not** modified and does not read the settings. See [Why the search provider is untouched](#why-the-search-provider-is-untouched). New permissions: `storage` and `menus`. Both are in Firefox's no-prompt class, so the install dialog gains no new lines and `data_collection_permissions: ["none"]` remains truthful. ## Goals 1. Ship a working options panel embedded in `about:addons`. 2. Ship two new entry points whose behaviour the panel controls. 3. Add no permission-warning lines to the install prompt. 4. Keep `data_collection_permissions: ["none"]` accurate. 5. Introduce unit testing for the pure logic, without new runtime dependencies. 6. Never promise behaviour that ChatGPT does not reliably deliver. ## Non-goals - Making the `gpt ` search provider configurable. Out of scope by decision; it requires either host permissions on `chatgpt.com` or a navigation-interception mechanism, both of which conflict with goals 3 and 4. - A toolbar button. - Named/multiple prompt templates with add-remove-reorder UI. One template only. - Reading the page selection from the keyboard shortcut. That requires `activeTab` + `tabs.executeScript`; deliberately excluded (see [Rejected alternatives](#rejected-alternatives)). - Migrating to Manifest V3. - Chrome or other-browser packaging (`AGENTS.md` browser scope). - User-facing error notifications. The `notifications` permission *does* generate an install warning, so every failure path degrades silently instead. ## Background and constraints The extension is currently manifest-only: no JavaScript exists, and the manifest declares no `background`, `content_scripts`, or `web_accessible_resources` key. Its single feature is `chrome_settings_overrides.search_provider` with `search_url: "https://chatgpt.com?q={searchTerms}"`. ### Why the search provider is untouched `chrome_settings_overrides.search_provider` is declarative and fixed at install time. No WebExtension API can rewrite an installed engine's URL. Making `gpt ` honour the settings would require intercepting the navigation it starts, which needs host access to `chatgpt.com` plus `webRequest` or `tabs` — all of which add install-prompt lines. Rejected in favour of goals 3 and 4. `is_default` stays `false`. Setting it to `true` triggers a second, separate consent doorhanger (`webext-default-search-description`) outside any permission list, plus an allowlist requirement. ### ChatGPT URL parameters are undocumented None of `q`, `model`, `hints`, or `temporary-chat` is documented by OpenAI. There is no contract and no support channel. The design is therefore resilient by construction: the URL is built from a template with no runtime dependency on any parameter being honoured, each parameter is independently removable so a user can bisect when ChatGPT ignores one, and all user-facing copy is written at hint strength. See [Appendix A](#appendix-a-verification-findings) for the evidence behind each parameter's confidence rating. The one parameter with quasi-official standing is `q`, because OpenAI's own "ChatGPT search" browser extension uses `https://chatgpt.com/?q=`. Build on it; treat everything else as best-effort. **`q` prefills but does not submit.** Auto-submit was real historically but has been prefill-only since approximately November 2025, after OpenAI gated it on the `Sec-Fetch-Site` header as a prompt-injection mitigation. No copy in the options panel, README, or AMO listing may say the query is *searched*, *sent*, or *asked* — only that ChatGPT opens **with the query filled in**. ## Architecture Manifest stays **V2**. Mozilla has not announced any MV2 deprecation and commits to at least 12 months' notice. The repo is MV2 today and has no Chrome target, so migration is an orthogonal change. The code is nonetheless kept MV3-portable: ES-module background, `persistent: false`, no `browser_style: true`. ES modules work in an MV2 background script via `"background": {"scripts": [...], "type": "module"}`, supported since Firefox 112 and verified empirically in Firefox 153.0.1. No background HTML shim is needed. The options page is a normal extension page and can use `