Skip to content

Commit da79536

Browse files
authored
docs: correct content script example code (#1811)
1 parent aaaff43 commit da79536

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,5 @@ Anyone is welcome to submit a blog post on <https://wxt.dev/blog>!
182182
> [!NOTE]
183183
> Before starting on a blog post, please message Aaron on Discord or start a discussion on GitHub to get permission to write about a topic, but most topics are welcome: Major version updates, tutorials, etc.
184184
185-
- **English only**: Blog posts should be written in English. Unfortunately, our maintainers doesn't have the bandwidth right now to translate our docs, let alone blog posts. Sorry 😓
185+
- **English only**: Blog posts should be written in English. Unfortunately, our maintainers don't have the bandwidth right now to translate our docs, let alone blog posts. Sorry 😓
186186
- **AI**: Please only use AI to translate or proof-read your blog post. Don't generate the whole thing... We don't want to publish that.

docs/guide/essentials/entrypoints.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,14 @@ When defining content script entrypoints, keep in mind that WXT will import this
300300

301301
<!-- prettier-ignore -->
302302
```ts
303-
browser.runtime.onMessage.addListener((message) => { // [!code --]
304-
// ... // [!code --]
305-
}); // [!code --]
303+
const container = document.createElement('div'); // [!code --]
304+
document.body.append(container); // [!code --]
306305

307-
export default defineBackground(() => {
308-
browser.runtime.onMessage.addListener((message) => { // [!code ++]
309-
// ... // [!code ++]
310-
}); // [!code ++]
306+
export default defineContentScript({
307+
main: function () {
308+
const container = document.createElement('div'); // [!code ++]
309+
document.body.append(container); // [!code ++]
310+
},
311311
});
312312
```
313313

0 commit comments

Comments
 (0)