Skip to content

feat: add Firefox AI sidebar (?q=) support to dashboard#1814

Merged
Evanev7 merged 1 commit into
exo-explore:mainfrom
ArvidSU:feat/firefox-ai-sidebar
Mar 30, 2026
Merged

feat: add Firefox AI sidebar (?q=) support to dashboard#1814
Evanev7 merged 1 commit into
exo-explore:mainfrom
ArvidSU:feat/firefox-ai-sidebar

Conversation

@ArvidSU
Copy link
Copy Markdown
Contributor

@ArvidSU ArvidSU commented Mar 29, 2026

This PR builds on #1677 to enable custom prompts sent from Firefox browser.ml.chat to EXO dashboard using URL parameters in sidebar for summary and other browser interactions. See "Summarize page" example below.

Summary

  • Parse ?q=<encoded prompt> URL parameter on page load and auto-submit it as a chat message
  • Clean up the URL with history.replaceState to prevent re-submission on refresh
  • Defer auto-send until both cluster state and model list are loaded so model auto-selection works correctly

Context

Firefox's built-in AI sidebar (about:config: browser.ml.chat.enabled) integrates with chat providers by appending the user's prompt as ?q=<URL-encoded prompt>. Previously the exo dashboard ignored this parameter. Users can now configure http://localhost:52415 as a Firefox AI chatbot provider.

See: https://support.mozilla.org/en-US/kb/ai-chatbot

Technical notes

  • Frontend-only change in dashboard/src/routes/+page.svelte
  • Uses a Svelte $effect that reacts to pendingFirefoxQuery, data (cluster state), and models.length — fires exactly once when all three are ready
  • If no model is selected, handleAutoSend auto-picks the best available model; if no model fits memory, a toast is shown
  • If a model is selected but not running, the message is queued until the model loads

Testing

http://localhost:52415/?q=Hello+world
http://localhost:52415/?q=Summarize+this+page%3A+%5Bpage+title%5D+%5Bpage+url%5D
image

Firefox's built-in AI sidebar sends the user's prompt as a ?q=<encoded>
query parameter to the configured provider URL. This change:

- Parses ?q= on page load and cleans the URL with history.replaceState
- Defers auto-send until cluster state and model list are loaded, so
  handleAutoSend can correctly auto-select a running or fitting model
- Uses a Svelte  that watches pendingFirefoxQuery, data, and
  models to fire exactly once when all dependencies are ready

See: https://support.mozilla.org/en-US/kb/ai-chatbot
@rltakashige
Copy link
Copy Markdown
Collaborator

Hey - this is really cool; it looks good to me, but I think it would be better if we put this at a /firefox endpoint so that we don't reserve the top-level ?q= for only Firefox.

@ArvidSU
Copy link
Copy Markdown
Contributor Author

ArvidSU commented Mar 30, 2026

@rltakashige Hmmm, I see the confusion with my variable naming and comments. However, there is not really anything functional that makes this Firefox specific, the ?q= param is more a de facto convention used by google and chatgpt etc. Since the url is configurable in firefox I can move it to a firefox specific path but my suggestion is to generalize the naming of variables and comments to align with convention. What do you think?

Copy link
Copy Markdown
Collaborator

@rltakashige rltakashige left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to think of an example where we might want to use the ?q= with anything else, but we agreed this seems like a sensible default. We can always move it if it ever becomes necessary.

Thanks for this contribution - I might add this to our integrations in #1810 .

@Evanev7 Evanev7 merged commit 10ef7ec into exo-explore:main Mar 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants