Skip to content

liangRXdev/oe-extension

 
 

Repository files navigation

Release GitHub release License: MIT Chrome Extension JavaScript GitHub stars

OpenEvidence Selection Opener

OpenEvidence Selection Opener is a lightweight Chrome extension for clinicians, students, and evidence-based medicine readers. Select text on a whitelisted page, click Ask OpenEvidence, and the extension opens the selection in OpenEvidence right next to the current tab. With a validated Groq API key, it can also rewrite selected recall-style text into editable foreground questions before sending them to OpenEvidence.

Personal fork note (liangRXdev). This fork adds a Dotflows integration on top of the upstream htlin222/oe-extension: it lets you pick one of your OpenEvidence Dotflows in the side panel and have it officially activated on the answer you send. Everything else tracks upstream. See Dotflows (fork addition) below. Maintained for personal use.

Selection toolbar demo

Features

  • Selection toolbar anchored above highlighted text.
  • UpToDate and Google buttons to search the selection beside the current tab.
  • Right-click Ask OpenEvidence context menu for pages and Chrome PDF selection fallback.
  • Opens OpenEvidence beside the current tab, optionally in the background.
  • Local query history with a dedicated options tab, recording each text sent to OpenEvidence (plus the original selection, prompt, and transformed text for PICO/custom rewrites).
  • Whitelist-based activation, including file:///* support.
  • BYOK Groq integration stored in chrome.storage.local.
  • Built-in PICO rewrite flow for evidence-based medicine questions.
  • Custom prompt buttons with user-defined names and prompt instructions.
  • Editable LLM output panel with Copy, Ask OpenEvidence, and Close.
  • Light, dark, or system appearance modes.
  • No runtime framework, no remote UI dependencies.

Default Whitelist

https://ankiuser.net/study
https://www.openevidence.com/*
http://uptodate.com/*
nejm.org/*
file:///*

Entries are URL prefixes. * can be used as a wildcard.

Install From Release

  1. Download the latest oe-extension-vX.Y.Z.zip from Releases.
  2. Unzip it.
  3. Open chrome://extensions.
  4. Enable Developer mode.
  5. Click Load unpacked.
  6. Select the unzipped extension folder.

The release also includes a .crx artifact generated by GitHub Actions.

Install From Source

git clone https://github.com/htlin222/oe-extension.git
cd oe-extension
npm test
npm run build

Then load dist/extension from chrome://extensions.

Local PDF Support

For local PDF files opened in Chrome:

  1. Open chrome://extensions.
  2. Open this extension's details.
  3. Enable Allow access to file URLs.

Chrome's built-in PDF viewer may not expose selection events to content scripts. When the floating toolbar does not appear, use the right-click context menu: select text, right click, choose Ask OpenEvidence.

Groq BYOK

The PICO and custom prompt buttons appear only after a Groq API key is validated.

  1. Open extension options.
  2. Under PICO rewrite, click Edit.
  3. Paste a Groq API key.
  4. Click Save.

The key is stored locally with chrome.storage.local; it is not committed, bundled, or sent anywhere except Groq API requests initiated by the extension.

Custom Prompts

Custom prompts let you create extra buttons beside Ask OpenEvidence and PICO. Each custom prompt has:

  • a button name, such as Dx, Summarize, or Guideline;
  • a prompt that tells Groq how to transform the selected text.

The model output is displayed in an editable panel. You can copy it or ask OpenEvidence with the edited result.

Dotflows (fork addition)

This section describes a feature added in this personal fork; it is not part of upstream htlin222/oe-extension.

Dotflows are OpenEvidence's reusable answer workflows (a saved explanation_prompt applied to a question). This fork lets you attach one of your own Dotflows to a question straight from the extension, so the answer is generated with that Dotflow already active — no manual selection on the OpenEvidence page.

How it works

  • The side panel fetches your Dotflow list from https://www.openevidence.com/api/dotflows/dot-flows using your existing logged-in session (credentials: "include"), and caches it locally for 30 minutes (chrome.storage.local, key oeDotflowsCache).
  • Pick a Dotflow in the floating selector. The extension appends oe_ext_dotflow_id=<id> to the openevidence.com/ask URL it opens.
  • A document_start, MAIN-world content script (src/dotflow-inject.js) patches fetch and XMLHttpRequest on that page. When OpenEvidence submits the question (POST /api/article), it injects dotflow: { id } into the request body under the confirmed inputs schema, then restores the original network functions.
  • The injection is one-shot per page load and touches only the matching OpenEvidence submit request; all other traffic is untouched.

Notes / limitations

  • Requires being logged in to OpenEvidence in the same browser profile.
  • Relies on OpenEvidence's private /api/dotflows and /api/article shapes, which may change without notice; if activation stops working, append &oe_ext_debug=1 to the /ask URL to log every POST endpoint seen and re-verify the schema.
  • Scoped to https://www.openevidence.com/ask* via manifest.json content scripts.

OpenEvidence URL

The extension opens selections with this URL shape:

https://www.openevidence.com/ask?query=<selected text>&configName=prod&attachments=%5B%5D&_rsc=1pln2

Release Workflow

Release packaging runs on GitHub release creation/publication:

  • runs the test suite;
  • builds dist/oe-extension-v<version>.zip;
  • packs dist/oe-extension-v<version>.crx;
  • uploads both files as release artifacts.

For stable CRX IDs across releases, add a repository secret named CRX_PRIVATE_KEY_BASE64 containing the base64-encoded Chrome extension private key. Without that secret, CI still generates a .crx, but Chrome may assign a new extension ID.

Development

npm test
npm run build

The project is intentionally plain Manifest V3 JavaScript, CSS, and HTML.

Citation

If you use this project, please cite it:

@software{lin2026oeextension,
  author = {Lin, Hsieh-Ting},
  title = {oe-extension: OpenEvidence selection helper for Chrome},
  year = {2026},
  url = {https://github.com/htlin222/oe-extension},
  version = {0.1.2}
}

License

This project is licensed under the MIT License.

About

Chrome extension for opening selected clinical text in OpenEvidence and rewriting selections into evidence-focused questions.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 78.3%
  • CSS 14.5%
  • HTML 6.5%
  • Other 0.7%