> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/js/all/chrome_plugins/events.md).

# Events

## When Installed

```javascript
chrome.runtime.onInstalled.addListener(() => {
  //......
});
```

## Bookmarks Created

```javascript
chrome.bookmarks.onCreated.addListener(function() {
  //......
});
```

## Tab changes

[tabs.onUpdated](https://developer.chrome.com/extensions/extensions/tabs#event-onUpdated)

## Navigation to Page

webNavigation supports filters

```javascript
 chrome.webNavigation.onCompleted.addListener(() => {
      alert("This is my favorite website!");
  }, {url: [{urlMatches : 'https://www.google.com/'}]});
```
