From f40005da362809f819e8a385b2b20badb194a5d5 Mon Sep 17 00:00:00 2001 From: Kral <118106297+dashitongzhi@users.noreply.github.com> Date: Mon, 29 Jun 2026 04:51:14 +0800 Subject: [PATCH] docs: document PerBrowser options for entrypoints (#2304) (#2403) Co-authored-by: dashitongzhi Co-authored-by: ded-furby --- .../essentials/target-different-browsers.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/guide/essentials/target-different-browsers.md b/docs/guide/essentials/target-different-browsers.md index 3abb8357..985fdf78 100644 --- a/docs/guide/essentials/target-different-browsers.md +++ b/docs/guide/essentials/target-different-browsers.md @@ -78,3 +78,28 @@ Here are some examples: ``` Alternatively, you can use the [`filterEntrypoints` config](/api/reference/wxt/interfaces/InlineConfig#filterentrypoints) to list all the entrypoints you want to build. + +## Per-Browser Options + +Some entrypoint options can be customized per build target by passing an object keyed by the [target browser](/guide/essentials/target-different-browsers#target-a-browser) instead of a single value. This is useful when different browsers need different match patterns, run timings, or other entrypoint behavior: + +```ts +export default defineContentScript({ + matches: { + chrome: ['*://chrome.example.com/*'], + firefox: ['*://firefox.example.com/*'], + }, + runAt: { + chrome: 'document_start', + firefox: 'document_end', + }, + + world: { + firefox: 'MAIN', + }, + + main(ctx) { + // ... + }, +}); +```