Skip to content

docs: document PerBrowser options for entrypoints (#2304)#2403

Open
dashitongzhi wants to merge 1 commit into
wxt-dev:mainfrom
dashitongzhi:feat/per-browser-entrypoint-docs-20260604091056
Open

docs: document PerBrowser options for entrypoints (#2304)#2403
dashitongzhi wants to merge 1 commit into
wxt-dev:mainfrom
dashitongzhi:feat/per-browser-entrypoint-docs-20260604091056

Conversation

@dashitongzhi

Copy link
Copy Markdown

Closes #2304.

Adds a 'Per-Browser Options' section to docs/guide/essentials/target-different-browsers.md
explaining PerBrowserOption<T> / PerBrowserMap<T> usage on entrypoint
config fields like matches, runAt, and defaultArea.

  • Explains the type shape: T | { [browser: TargetBrowser]: T }
  • Lists the entrypoint fields that accept it (matches, runAt, matchAboutBlank, excludeMatches, includeGlobs, excludeGlobs, allFrames, matchOriginAsFallback, cssInjectionMode, registration, defaultTitle, defaultArea, persistent)
  • Shows both forms (single value, per-browser map) with concrete defineContentScript examples
  • Notes the fallback behavior when a build target is omitted from the map
  • Adds a tip about mixing both forms inside the same entrypoint
  • Cross-references Manifest config for fields that don't fit the per-key shape (e.g. default_icon)

Adds a 'Per-Browser Options' section to target-different-browsers.md
explaining PerBrowserOption<T> / PerBrowserMap<T> usage on entrypoint
config fields like matches, runAt, and defaultArea.

Closes wxt-dev#2304.
Copilot AI review requested due to automatic review settings June 4, 2026 01:14
@netlify

netlify Bot commented Jun 4, 2026

Copy link
Copy Markdown

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 233e1f1
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6a20d16fa07d2c000879e50b
😎 Deploy Preview https://deploy-preview-2403--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds documentation for configuring entrypoint options per build target (browser), explaining the PerBrowserOption/map pattern and providing examples.

Changes:

  • Introduces a new “Per-Browser Options” section describing per-browser option values and maps
  • Adds examples for using a single value vs. per-browser maps
  • Notes fallback behavior when a target is omitted and links to a manifest-level workaround

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +87 to +88
export type PerBrowserOption<T> = T | PerBrowserMap<T>;
export type PerBrowserMap<T> = { [browser: TargetBrowser]: T };
});
```

If a build target is omitted from the map, that build inherits the build's default for that field (typically the same as if you didn't set the option at all). For example, the `safari` build above would fall back to WXT's default `runAt`.
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.51%. Comparing base (7905cb3) to head (233e1f1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2403      +/-   ##
==========================================
+ Coverage   78.46%   78.51%   +0.05%     
==========================================
  Files         133      133              
  Lines        3882     3882              
  Branches      875      875              
==========================================
+ Hits         3046     3048       +2     
+ Misses        749      747       -2     
  Partials       87       87              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Jun 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@2403

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@2403

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@2403

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@2403

@wxt-dev/is-background

npm i https://pkg.pr.new/@wxt-dev/is-background@2403

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@2403

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@2403

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@2403

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@2403

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@2403

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@2403

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@2403

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@2403

wxt

npm i https://pkg.pr.new/wxt@2403

commit: 233e1f1

@PatrykKuniczak

PatrykKuniczak commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

@dashitongzhi I think it's alright, but wait for Aaron approval.

But i think we should make TargetBrowser not string but put a literal with browsers name there:

export type TargetBrowser = string;

Feel free to open another PR.

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.

Document entrypoint PerBrowser options

3 participants