Skip to content

Commit f40005d

Browse files
docs: document PerBrowser options for entrypoints (#2304) (#2403)
Co-authored-by: dashitongzhi <dashitongzhi@users.noreply.github.com> Co-authored-by: ded-furby <ded-furby@users.noreply.github.com>
1 parent 34afac0 commit f40005d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

docs/guide/essentials/target-different-browsers.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,28 @@ Here are some examples:
7878
```
7979

8080
Alternatively, you can use the [`filterEntrypoints` config](/api/reference/wxt/interfaces/InlineConfig#filterentrypoints) to list all the entrypoints you want to build.
81+
82+
## Per-Browser Options
83+
84+
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:
85+
86+
```ts
87+
export default defineContentScript({
88+
matches: {
89+
chrome: ['*://chrome.example.com/*'],
90+
firefox: ['*://firefox.example.com/*'],
91+
},
92+
runAt: {
93+
chrome: 'document_start',
94+
firefox: 'document_end',
95+
},
96+
97+
world: {
98+
firefox: 'MAIN',
99+
},
100+
101+
main(ctx) {
102+
// ...
103+
},
104+
});
105+
```

0 commit comments

Comments
 (0)