docs: document PerBrowser options for entrypoints (#2304)#2403
docs: document PerBrowser options for entrypoints (#2304)#2403dashitongzhi wants to merge 1 commit into
Conversation
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.
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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.
| 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/is-background
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/runner
@wxt-dev/storage
@wxt-dev/unocss
@wxt-dev/webextension-polyfill
wxt
commit: |
|
@dashitongzhi I think it's alright, but wait for Aaron approval. But i think we should make Line 569 in 7905cb3 Feel free to open another PR. |
Closes #2304.
Adds a 'Per-Browser Options' section to docs/guide/essentials/target-different-browsers.md
explaining
PerBrowserOption<T>/PerBrowserMap<T>usage on entrypointconfig fields like
matches,runAt, anddefaultArea.T | { [browser: TargetBrowser]: T }defineContentScriptexamplesdefault_icon)