Skip to content

Commit

Permalink
doc: Fix bad extension API examples (wxt-dev#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
couriourc authored Apr 12, 2024
1 parent 2a4fa9a commit c099942
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guide/extension-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Then we can use `browser.storage` to save the install date to local storage.
```ts
// background.ts
export default defineBackground(() => {
browser.runtime.onInstall.addEventListener(({ reason }) => {
browser.runtime.onInstalled.addListener(({ reason }) => {
if (reason === 'install') {
browser.storage.local.setItem({ installDate: Date.now() });
browser.storage.local.set({ installDate: Date.now() });
}
});
});
Expand Down

0 comments on commit c099942

Please sign in to comment.