ollama - 💡(How to fix) Fix Add trusted browser extension onboarding with extension-ID allowlist (CORS-safe local integrations) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15680Fetched 2026-04-19 15:04:17
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Root Cause

  • Enables local-first browser extension ecosystem
  • Safer than allowing all extensions
  • Eliminates hidden-tab/injection workarounds
  • Restores full API functionality (including streaming)
  • Improves developer experience

Fix Action

Fix / Workaround

This makes it difficult to build secure, local-first integrations (e.g., Chrome extensions) without relying on fragile workarounds. I am currently building a browser extension which uses Ollama for filling out Forms online. i.e job applications . This is disrupting the onboarding experience as they have to run a command in the terminal to allow chrome explicitly which is a pain for non technical users and its turning them away.

  • No first-class support for browser extensions
  • Coarse control (e.g., chrome-extension://* allows all extensions)
  • No user-facing approval/onboarding flow
  • No way to list/revoke allowed extensions
  • Forces workaround patterns (hidden tabs, injected scripts)

This workaround:

  • Adds complexity
  • Breaks streaming (must use stream: false)
  • Introduces lifecycle/race issues
  • Feels like a hack rather than a supported path
RAW_BUFFERClick to expand / collapse

Summary

Ollama currently supports custom origins via OLLAMA_ORIGINS, including browser extension origins like chrome-extension://*. However, this approach is too coarse and lacks a first-class onboarding flow for browser extensions.

This makes it difficult to build secure, local-first integrations (e.g., Chrome extensions) without relying on fragile workarounds. I am currently building a browser extension which uses Ollama for filling out Forms online. i.e job applications . This is disrupting the onboarding experience as they have to run a command in the terminal to allow chrome explicitly which is a pain for non technical users and its turning them away.

https://apply.offlyn.ai

Problem

Browser extensions cannot reliably POST to Ollama due to strict Origin validation:

Origin: chrome-extension://<extension-id>

Unless users manually configure OLLAMA_ORIGINS, requests are rejected.

Current limitations

  • No first-class support for browser extensions
  • Coarse control (e.g., chrome-extension://* allows all extensions)
  • No user-facing approval/onboarding flow
  • No way to list/revoke allowed extensions
  • Forces workaround patterns (hidden tabs, injected scripts)

Real-world impact

To make extensions work today, developers must:

This workaround:

  • Adds complexity
  • Breaks streaming (must use stream: false)
  • Introduces lifecycle/race issues
  • Feels like a hack rather than a supported path

Proposal

Introduce a first-class trusted browser extension model with explicit onboarding and per-extension allowlisting.

1) Extension ID–based allowlist

Allow explicit configuration of trusted extensions:

OLLAMA_ORIGINS=chrome-extension://abc123...

Encourage specific extension IDs instead of wildcards like chrome-extension://*.

2) Interactive onboarding (recommended)

When an unknown extension attempts access, prompt the user:

A browser extension is requesting access to Ollama:

Origin: chrome-extension://abc123... Requested endpoints: /api/generate, /api/embeddings

Allow? [ ] Allow once [ ] Always allow [ ] Deny

Benefits:

  • Explicit user consent
  • Visibility into who is accessing Ollama
  • Aligns with browser/OS permission models

3) Persistent trusted extension registry

Store approved extensions locally (file or config):

{ "trusted_extensions": [ { "origin": "chrome-extension://abc123...", "permissions": ["generate", "embeddings"], "added_at": "2026-04-18T00:00:00Z" } ] }

4) Management commands

Examples:

ollama extensions list ollama extensions allow chrome-extension://abc123... ollama extensions revoke chrome-extension://abc123...

Optional: lightweight local UI

5) (Optional) Permission scoping

Per-extension scopes:

  • generate (chat/completions)
  • embeddings
  • pull (model downloads)
  • list (model listing)

Why this matters

  • Enables local-first browser extension ecosystem
  • Safer than allowing all extensions
  • Eliminates hidden-tab/injection workarounds
  • Restores full API functionality (including streaming)
  • Improves developer experience

Backward compatibility

  • Existing OLLAMA_ORIGINS behavior remains unchanged
  • New functionality is additive and opt-in

Alternative considered

Hidden tab + injected script proxy:

  • Works today but is complex, fragile, and breaks streaming
  • Not suitable as a long-term solution

Ask

Would you be open to supporting a first-class trusted extension flow (ID-based allowlist + optional onboarding prompt)?

Happy to contribute implementation if aligned.

extent analysis

TL;DR

Implement a first-class trusted browser extension model with explicit onboarding and per-extension allowlisting to improve security and user experience.

Guidance

  • Introduce an extension ID-based allowlist to explicitly configure trusted extensions, encouraging specific extension IDs instead of wildcards.
  • Develop an interactive onboarding process to prompt users when an unknown extension attempts access, providing explicit user consent and visibility into who is accessing Ollama.
  • Create a persistent trusted extension registry to store approved extensions locally, including their origin, permissions, and added timestamp.
  • Design management commands, such as ollama extensions list and ollama extensions allow, to simplify extension management.
  • Consider implementing permission scoping to define per-extension scopes, such as generate, embeddings, pull, and list.

Example

A potential implementation of the trusted extension registry could be a JSON file containing a list of trusted extensions, each with its origin, permissions, and added timestamp:

{
  "trusted_extensions": [
    {
      "origin": "chrome-extension://abc123...",
      "permissions": ["generate", "embeddings"],
      "added_at": "2026-04-18T00:00:00Z"
    }
  ]
}

Notes

The proposed solution aims to improve the security and user experience of browser extensions interacting with Ollama, eliminating the need for fragile workarounds and hidden tabs. However, the implementation details may vary depending on the specific requirements and constraints of the Ollama project.

Recommendation

Apply the proposed workaround of implementing a first-class trusted browser extension model, as it provides a more secure and user-friendly solution compared to the current coarse control and workaround patterns. This approach enables a local-first browser extension ecosystem, safer than allowing all extensions, and restores full API functionality, including streaming.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - 💡(How to fix) Fix Add trusted browser extension onboarding with extension-ID allowlist (CORS-safe local integrations) [1 participants]