Skip to content
AnswerWell geo Documentation

Research · 6 min read · Answerwell

Extension API Enumerations, Resource Types, and Setting Scopes

What extension API enum strings mean for networks, permissions, navigation, profiles, and how MV2 and MV3 references relate.

This page summarises enumeration and typed constant values from Chrome Extensions API reference documentation (browser.* for Manifest V3 and parallel chrome.* pages for Manifest V2). These strings appear in manifest rules, event listeners, and option objects; using the wrong literal usually means a rule never matches or a callback receives an unexpected value.

Extension API enumerations: what the string literals are for

Section titled “Extension API enumerations: what the string literals are for”

Extension APIs expose many properties as fixed string enums rather than free-form text. Each value is documented on the API page that defines it—for example browser.contentSettings, browser.declarativeNetRequest, and browser.history. When you read “Enum” in the reference, treat every listed string as the only legal value for that field unless the page states otherwise.

Content settings: allow, block, ask, and session_only

Section titled “Content settings: allow, block, ask, and session_only”

Site permission-style APIs use a small set of decision strings. On browser.contentSettings, one enum is:

“allow”

“block”

— Chrome, browser.contentSettings

Another enum on the same API adds user prompting:

“allow”

“block”

“ask”

— Chrome, browser.contentSettings

A third pattern allows temporary allowance:

“allow”

“block”

“session_only”

— Chrome, browser.contentSettings

allow permits the capability for the chosen scope. block denies it. ask defers to a user prompt where the API supports it. session_only allows until the browsing session ends (typical for incognito-only overrides). Pick the enum that matches the property on the specific contentSettings key you are setting—not every content type exposes all four values.

ContentSetting scope: regular and incognito_session_only

Section titled “ContentSetting scope: regular and incognito_session_only”

Scope controls whether a value applies to the normal profile, incognito, or both. Chrome documents:

The scope of the ContentSetting. One of regular: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere), incognito_session_only: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings).

— Chrome, browser.contentSettings

The scope enum values are "regular" and "incognito_session_only". For broader browser preferences (not only per-site content settings), chrome.types defines ChromeSettingScope with four values: "regular", "regular_only", "incognito_persistent", and "incognito_session_only"—incognito can inherit, stay isolated, persist across restarts, or exist only for one incognito session.

Network rules: ResourceType, DomainType, and HTTP methods

Section titled “Network rules: ResourceType, DomainType, and HTTP methods”

ResourceType in declarativeNetRequest and webRequest

Section titled “ResourceType in declarativeNetRequest and webRequest”

Declarative network rules and the older webRequest API classify traffic by resource kind. Chrome defines ResourceType as:

This describes the resource type of the network request.

— Chrome, browser.declarativeNetRequest

Shared enum strings include main_frame, sub_frame, stylesheet, script, image, font, object, xmlhttprequest, ping, csp_report, media, websocket, and other. Manifest V3 adds webtransport and webbundle on browser.declarativeNetRequest; browser.webRequest documents the overlapping set without webtransport in the cluster excerpt.

Use these literals in rule conditions (resourceTypes) so blocking or redirect logic runs on the requests you intend—e.g. script vs xmlhttprequest for ad blockers vs XHR filters.

For cookie and tracking rules, party relationship matters:

This describes whether the request is first or third party to the frame in which it originated. A request is said to be first party if it has the same domain (eTLD+1) as the frame in which it originated.

— Chrome, browser.declarativeNetRequest

The enum values are "firstParty" and "thirdParty". Mislabeling party type is a common reason declarative rules appear to “do nothing” on embedded widgets or CDN assets.

Rule conditions can match methods such as "connect", "delete", "get", "head", "options", "patch", "post", "put", and "other" (browser.declarativeNetRequest).

Section titled “Navigation and history: transition type strings”

Extensions that log or filter visits use transition enums from browser.history and browser.webNavigation. Examples from the history API:

“link” The user arrived at this page by clicking a link on another page.

— Chrome, browser.history

“typed” The user arrived at this page by typing the URL in the address bar. This is also used for other explicit navigation actions.

— Chrome, browser.history

“generated” The user arrived at this page by typing in the address bar and selecting an entry that didn’t look like a URL, such as a Google Search suggestion.

— Chrome, browser.history

Other transition strings in the cluster include auto_bookmark, auto_subframe, manual_subframe, auto_toplevel, form_submit, reload, keyword, and keyword_generated. browser.webNavigation also lists transition qualifiers such as client_redirect, server_redirect, forward_back, and from_address_bar—combine qualifier + transition when building analytics that mirror Chrome’s internal navigation model.

Runtime, tabs, and execution context enums

Section titled “Runtime, tabs, and execution context enums”

browser.runtime documents context types including "TAB", "POPUP", "BACKGROUND" (service worker), "OFFSCREEN_DOCUMENT", "SIDE_PANEL", and "DEVELOPER_TOOLS". browser.extensionTypes lists script worlds: "ISOLATED", "MAIN", and "USER_SCRIPT" (with browser.userScripts defining "MAIN" vs "USER_SCRIPT" execution environments). browser.scripting uses "AUTHOR" and "USER" for injection metadata.

Tab lifecycle enums on browser.tabs include status "unloaded", "loading", "complete" and window types such as "normal", "popup", "panel", "app", and "devtools".

Settings control: LevelOfControl and notifications

Section titled “Settings control: LevelOfControl and notifications”

Font and privacy-related APIs share precedence enums. browser.fontSettings documents LevelOfControl as:

One of not_controllable: cannot be controlled by any extension controlled_by_other_extensions: controlled by extensions with higher precedence controllable_by_this_extension: can be controlled by this extension controlled_by_this_extension: controlled by this extension

— Chrome, browser.fontSettings

The same four strings appear on browser.types. Check control level before calling set()—otherwise Chrome silently keeps another extension’s value.

browser.notifications permission level is "granted" (default at install) or "denied".

Cookies, downloads, and other specialised enums

Section titled “Cookies, downloads, and other specialised enums”
API Enum role Values (from cluster)
browser.cookies Removal cause evicted, expired, explicit, expired_overwrite, overwrite
browser.cookies SameSite no_restriction, lax, strict, unspecified
browser.downloads Conflict action uniquify, overwrite, prompt
browser.downloads State in_progress, interrupted, complete
browser.idle User presence active, idle, locked

Filename conflict behaviour is spelled out on browser.downloads: uniquify adds a counter before the extension, overwrite replaces the file, prompt opens a file chooser.

Obsolete and platform-specific enum values

Section titled “Obsolete and platform-specific enum values”

Some enums remain in the reference but are marked unused. On browser.processes, "worker" and "service_worker" are labelled obsolete and will never be returned. Prefer current process types (browser, renderer, extension, gpu, etc.) when handling onUpdated events.

Hardware-oriented APIs (e.g. browser.audio device types HEADPHONE, MIC, BLUETOOTH, or browser.documentScan scanner constraints) use long enums tied to OS drivers; always branch on the exact string returned by the device, not on assumptions from desktop-only testing.

Common mistakes when using extension API enums

Section titled “Common mistakes when using extension API enums”
  • Wrong namespace: Using chrome.* strings in MV3 service workers without the chrome global, or mixing MV2-only scopes with MV3 browser.contentSettings scope (two values vs four on ChromeSettingScope).
  • Case and spelling: Enum values are case-sensitive (firstParty, not first_party).
  • Assuming parity: webRequest and declarativeNetRequest resource type lists differ slightly (webtransport / webbundle).
  • Ignoring scope: Setting regular while testing only in incognito, or expecting session_only to persist after restart.
  • Treating obsolete values as live: Listening for service_worker process type though the docs state it is never returned.
  1. Open the API page for the property you use (for example browser.declarativeNetRequest or browser.contentSettings) and confirm your code uses only enum strings listed there.

  2. Load your extension unpacked, reproduce the action (navigation, download, rule match), and log the raw string from the callback or get() result in the service worker or background context documented on browser.runtime.

  3. If a declarative rule does not fire, verify resourceTypes, method, and domainType against live requests using browser.devtools.network (HAR-style request objects) or the DevTools guide on inspecting behaviour (Pause your code with breakpoints).

  4. For incognito behaviour, test both scopes (regular vs incognito_session_only or ChromeSettingScope on chrome.types) in a private window and after browser restart.

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page does not match the official API reference, email yimasynthetic@gmail.com with the page URL and the exact enum or quote you believe is wrong, and we will correct it.