Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/mozilla/add-ons/webextensions/api/declarativenetrequest/getdynamicrules/index.md
6546 views
---
title: declarativeNetRequest.getAvailableStaticRuleCount slug: Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/getDynamicRules tags: - API - Add-ons - Extensions - Reference - WebExtensions - Method - declarativeNetRequest - getDynamicRules browser-compat: webextensions.api.declarativeNetRequest.getDynamicRules
---

{{AddonSidebar()}}

Returns the set of dynamic rules for the extension.

Syntax

let gettingDynamicRules = browser.declarativeNetRequest.getDynamicRules();

Parameters

This function takes no parameters.

Return value

A Promise is fulfilled with an array of {{WebExtAPIRef("declarativeNetRequest.Rule")}} objects. Each of these represents a rule that belongs to the extension. If no rules are active, the array is empty. If the request fails, the promise is rejected with an error message.

Examples

{{WebExtExamples}}

Browser compatibility

{{Compat}}