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/getsessionrules/index.md
6555 views
---
title: declarativeNetRequest.getSessionRules slug: Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/getSessionRules tags: - API - Add-ons - Extensions - Reference - WebExtensions - Method - declarativeNetRequest - getSessionRules browser-compat: webextensions.api.declarativeNetRequest.getSessionRules
---

{{AddonSidebar()}}

Returns the active set of session scoped rules for the extension.

Syntax

let sessionRules = await browser.declarativeNetRequest.getSessionRules();

Parameters

This function takes no parameters.

Return value

A Promise fulfilled with an array of {{WebExtAPIRef("declarativeNetRequest.Rule")}} objects. If no rules are active, the object is empty. If the request fails, the promise is rejected with an error message

Examples

{{WebExtExamples}}

Browser compatibility

{{Compat}}