# 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 does the same for the current selection, falling back to a fresh empty chat when nothing is selected. 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`, `menus`, and `activeTab`. All three 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. The declarative `search_url` is fixed at install time, and the three routes around that were each rejected: host permissions plus navigation interception (conflicts with goals 3 and 4), a bundled extension page as `search_url` (Firefox refuses to install), and `browser.omnibox` (works, but moves the transmitter of search terms from Firefox to extension code — see Risk 6). `gpt ` keeps behaving exactly as it does today. - Auto-submitting the prompt on the user's behalf. Rejected on security grounds after dedicated adversarial testing; see [Appendix B](#appendix-b-why-auto-submit-was-rejected). - Moving the `gpt` keyword to `browser.omnibox`. Deliberately declined to minimise AMO data-collection exposure, not for lack of a working mechanism. - A toolbar button. - Named/multiple prompt templates with add-remove-reorder UI. One template only. - 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 — confirmed for this extension.** 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. Verified on 2026-07-29 in the maintainer's own logged-in Firefox profile, on this extension's actual navigation path: the prompt lands in the composer and waits. The user presses Enter twice — once to leave the address bar, once to send. The hypothesis that address-bar navigation might still be favoured (`Sec-Fetch-Site: none` being the most-trusted value) **does not hold in practice**. 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**. The two-keypress behaviour is an upstream ChatGPT change, not a defect in this extension, and is documented as such rather than worked around; see [Rejected alternatives](#rejected-alternatives). ## 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 `