> [!WARNING]
> **Warning:** The Chrome Web Store no longer accepts Manifest V2 extensions. Follow the [Manifest V3 Migration guide](https://developer.chrome.com/docs/extensions/migrating) to convert your extension to Manifest V3.

> [!NOTE]
> **Note:** You have been redirected from Manifest V3. Chrome extensions no longer support this feature.

The `event_rules` manifest property provides a mechanism to add rules that intercept, block, or
modify web requests in-flight using [declarativeWebRequest](https://developer.chrome.com/docs/extensions/mv2/reference/declarativeWebRequest.md.txt) or take actions depending on the
content of a page, without requiring permission to read the page's content using
[declarativeContent](https://developer.chrome.com/docs/extensions/mv2/reference/declarativeContent.md.txt).

## Translating rules from javascript to manifest

The following defines a rule to display a page action if the current page has a video css tag in
javascript:

```javascript
chrome.declarativeContent.onPageChanged.addRules([{
  actions: [
    new chrome.declarativeContent.ShowPageAction()
  ],
  conditions: [
    new chrome.declarativeContent.PageStateMatcher(
        {css: ["video"]}
    )
  ]
}]);
```

This is the same definition in the manifest:

```json
{
  "name": "Sample extension",
  "event_rules": [{
    "event": "declarativeContent.onPageChanged",
    "actions": [{
      "type": "declarativeContent.ShowPageAction"
    }],
    "conditions": [{
      "type": "declarativeContent.PageStateMatcher",
      "css": ["video"]
    }]
  }],
  ...
}
```