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: top-level action menu cap
Section titled “contextMenus: top-level action menu cap”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).
printing API: documented call quotas
Section titled “printing API: documented call quotas”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: recently closed list size
Section titled “sessions: recently closed list size”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.
Sentinel tab, window, and tab group IDs
Section titled “Sentinel tab, window, and tab group IDs”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.
windows: current window and no window
Section titled “windows: current window and no window”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: ungrouped tabs
Section titled “tabGroups: ungrouped tabs”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.
webRequest: handlerBehaviorChanged quota
Section titled “webRequest: handlerBehaviorChanged quota”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.
Common mistakes
Section titled “Common mistakes”- One giant
updateDynamicRulespayload — stay within 100 rules per call even when total capacity is 30 000. - Treating
TAB_ID_NONE(−1) orWINDOW_ID_CURRENT(−2) as real IDs — resolve withtabs.query/windows.getCurrentfirst. - Six flat action menu items — use submenus under
contextMenus. - Assuming
getRecentlyClosedis 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.
How to check this on your site
Section titled “How to check this on your site”- Load the unpacked extension in
chrome://extensions, open its service worker or background console, and logchrome.declarativeNetRequest.getDynamicRules()/getSessionRules()lengths against the declarativeNetRequest table (30 000, 5 000, 1 000, 10 rulesets). - Trigger
getMatchedRulessparingly and confirm you stay under 20 calls per 10 minutes and 50 rules per response, as described on declarativeNetRequest. - Before
tabs.removeortabs.captureVisibleTab, verify tab IDs are not −1 and throttle captures to 2 per second per the tabs reference. - When using
windowsortabGroupsAPIs, 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. - You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”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).