Skip to content
AnswerWell geo Documentation

Research · 5 min read · Answerwell

Extension API Quotas, Rule Limits and Sentinel IDs

Chrome extension API maximum rule counts, rate limits, and special tab and window ID values from the official reference.

This page summarises numeric limits, quotas, and sentinel ID constants from Chrome Extensions reference APIs on developer.chrome.com. The same figures appear under Manifest V3 browser.* namespaces and legacy Manifest V2 chrome.* pages. Most of the cluster is about declarativeNetRequest; the rest covers menus, printing, sessions, tabs, webRequest, windows, and tab groups.

If you are hitting “quota exceeded”, “too many rules”, or “invalid tab/window ID” while building an extension, these documented caps and magic numbers are usually what the runtime is enforcing.

declarativeNetRequest: static, dynamic and session rule limits

Section titled “declarativeNetRequest: static, dynamic and session rule limits”

declarativeNetRequest (DNR) replaces blocking webRequest for network filtering in Manifest V3. Chrome documents hard upper bounds on how many rules and rulesets an extension may hold at once. Exceeding them makes updateStaticRules, updateDynamicRules, or updateSessionRules fail until you delete or consolidate rules.

Constant (documented cap) Value Typical meaning
Static rulesets in the manifest 10 How many static ruleset files you may declare
Dynamic rules 30 000 Upper bound on rules added at runtime via updateDynamicRules
Session rules 5 000 Upper bound on temporary rules via updateSessionRules
Rules per static ruleset 1 000 Maximum rules inside one static ruleset file
Rules using a regular expression 1 000 Cap on regex-based conditions across the extension’s DNR rules

The legacy MV2 mirror is chrome.declarativeNetRequest; the numeric caps match the MV3 browser.declarativeNetRequest reference.

getMatchedRules: call frequency and result size

Section titled “getMatchedRules: call frequency and result size”

Debugging DNR often uses getMatchedRules. Chrome documents separate quotas from the rule storage limits:

Quota Value
Calls allowed per 10 minutes 20
Rules returned in one call 50

Treat 20 and 50 as paired limits: frequent polling in a loop will trip the call quota even when total stored rules are far below 30 000.

updateDynamicRules and updateSessionRules: batch size

Section titled “updateDynamicRules and updateSessionRules: batch size”

Each single update call may only add, remove, or modify a bounded number of rules at once:

Operation Max rules per call
updateDynamicRules 100
updateSessionRules 100 (same batch cap as dynamic updates)

To load thousands of dynamic rules, batch 100 rules per call and wait for success before the next batch. One oversized payload is a common cause of quota errors that look like storage limits but are really per-call caps.

contextMenus lets extensions add entries to the browser context menu and the extension’s action menu. Chrome enforces a small cap on how many top-level items an extension may expose in the primary action menu area—documented as 6 on both browser.contextMenus and chrome.contextMenus.

Use submenus (parentId) for larger command sets instead of many sibling top-level entries. Nesting does not remove other menu rules (duplicate IDs, invalid contexts, or creating items before the extension is ready still fail).

The printing API (ChromeOS-focused enterprise printing) documents rate-style limits on hot methods. Reference values from the cluster are 20 and 40; they map to throttles on printer discovery versus job submission paths—see the limits table on browser.printing and chrome.printing.

Cache getPrinters results and avoid tight polling loops; batch or queue submitJob work if you approach the higher submission quota (40).

sessions.getRecentlyClosed returns a bounded list of closed windows and tabs. The documented maximum number of entries is 25 on browser.sessions and chrome.sessions.

Older sessions fall off the list even though Chrome may still restore more history through other UI paths—do not assume unbounded session storage from this API.

Several browser APIs use negative integers as “no object” or “current object” placeholders. Passing a positive ID where a sentinel is required produces Invalid tab ID / Invalid window ID errors.

tabs: invalid tab ID and captureVisibleTab rate

Section titled “tabs: invalid tab ID and captureVisibleTab rate”

On tabs:

Constant / limit Value Use
TAB_ID_NONE −1 Invalid or missing tab; do not use in tabs.get, tabs.remove, etc.
captureVisibleTab call rate 2 per second Throttle screenshots of the visible tab

chrome.tabs documents the same −1 sentinel and capture throttle.

On windows:

Constant Value Use
WINDOW_ID_CURRENT −2 Target the window that contains the calling context
WINDOW_ID_NONE −1 No window; invalid for operations that need a real window

chrome.windows lists the same sentinels.

tabGroups.TAB_GROUP_ID_NONE is −1: tabs not in any group. chrome.tabGroups uses the same value. Filtering or moving groups requires distinguishing real positive group IDs from −1.

Manifest V2 extensions with blocking webRequest still rely on handlerBehaviorChanged to invalidate the host cache after rule changes. Chrome documents a throttle of 20 calls per 10 minutes on browser.webRequest and chrome.webRequest—the same order of magnitude as DNR getMatchedRules.

New Manifest V3 work should use DNR instead of blocking webRequest; if you maintain both paths, share one debounced “rules changed” notifier so you do not exhaust either quota.

  • One giant updateDynamicRules payload — stay within 100 rules per call even when total capacity is 30 000.
  • Treating TAB_ID_NONE (−1) or WINDOW_ID_CURRENT (−2) as real IDs — resolve with tabs.query / windows.getCurrent first.
  • Six flat action menu items — use submenus under contextMenus.
  • Assuming getRecentlyClosed is complete history — only 25 recent sessions are returned.
  • Ignoring regex rule budget — regex conditions count toward the 1 000 regex rule cap separately from total rule counts.
  1. Load the unpacked extension in chrome://extensions, open its service worker or background console, and log chrome.declarativeNetRequest.getDynamicRules() / getSessionRules() lengths against the declarativeNetRequest table (30 000, 5 000, 1 000, 10 rulesets).
  2. Trigger getMatchedRules sparingly and confirm you stay under 20 calls per 10 minutes and 50 rules per response, as described on declarativeNetRequest.
  3. Before tabs.remove or tabs.captureVisibleTab, verify tab IDs are not −1 and throttle captures to 2 per second per the tabs reference.
  4. When using windows or tabGroups APIs, log IDs and confirm you are not passing −1 or −2 where a concrete tab, window, or group ID is required—see windows and tabGroups.
  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If a limit on this page does not match what you see in Chrome, email yimasynthetic@gmail.com with the page URL, the statement you disagree with, and your Chrome version (chrome://version).