Extension API Enumeration: getAll, getDevices, and Runtime State
How Chrome extension list-and-read APIs work—getAll, getDevices, permissions, promises, and platform limits across the extension reference.
This page summarizes Chrome extension API reference material for methods that enumerate or read current state: getAll(), getDevices(), getInfo(), and related getters. The same behaviors appear under the browser.* namespace in current reference pages and under chrome.* on many Manifest V2 (MV2) pages. The cluster is almost entirely Chrome developer documentation; one related pattern appears in the Content Indexing API.
chrome.* vs browser.*: which namespace to call
Section titled “chrome.* vs browser.*: which namespace to call”Both namespaces expose the same extension platform APIs. Current reference docs often show browser.alarms.getAll() returning a Promise, while MV2 pages document chrome.alarms.getAll() with an optional callback and the same promise when you omit the callback.
Gets an array of all the alarms.
— Chrome, alarms
Gets an array of all the alarms.
— Chrome, alarms (MV2)
For new MV3 extensions, follow the browser.* / promise-first signatures on the non-MV2 reference URLs. When maintaining legacy code or reading older samples, expect chrome.* plus optional callbacks. Method semantics (return type, permissions, errors) match between the paired pages in this cluster.
getAll(): list everything the extension owns or can see
Section titled “getAll(): list everything the extension owns or can see”getAll() is the most repeated name in the reference. It does not mean one shared API; each namespace defines its own array or object type.
| API namespace | What getAll() returns |
Typical use |
|---|---|---|
| alarms | Alarm[] |
Inspect scheduled alarms |
| commands | Command[] |
Shortcuts registered for this extension |
| notifications | object |
Notifications created by this extension |
| permissions | Permissions |
Granted permissions (not the same as contains) |
| management | ExtensionInfo[] |
Installed extensions and apps (needs management) |
| fileSystemProvider | FileSystemInfo[] |
File systems mounted by the provider extension |
commands.getAll() and the _execute_action shortcut
Section titled “commands.getAll() and the _execute_action shortcut”getAll() on commands returns registered extension commands and their active shortcut, if any.
Returns all the registered extension commands for this extension and their shortcut (if active). Before Chrome 110, this command did not return _execute_action.
— Chrome, commands
If you rely on the default action shortcut in UI or tests, confirm behavior on your minimum Chrome version.
cookies.getAllCookieStores() vs getAll()
Section titled “cookies.getAllCookieStores() vs getAll()”Cookie listing uses a dedicated name: getAllCookieStores() lists cookie stores (for example normal vs incognito), not individual cookies.
Lists all existing cookie stores.
— Chrome, cookies
Do not assume every “list” method is named getAll().
getDevices() and getInfo(): hardware, media, and system state
Section titled “getDevices() and getInfo(): hardware, media, and system state”Another large group filters or returns device and system snapshots.
Audio, Bluetooth, HID, USB, serial
Section titled “Audio, Bluetooth, HID, USB, serial”- browser.audio.getDevices() — optional
DeviceFilter, returnsAudioDeviceInfo[]. - chrome.bluetooth.getDevices() — known devices; discovery uses
startDiscovery()/stopDiscovery()separately. - chrome.hid.getDevices() — connected HID devices.
- chrome.usb.getDevices() — enumerated USB devices.
- chrome.serial.getDevices() — serial devices; list is regenerated on each call.
For Bluetooth, the reference stresses that discovery is resource-intensive:
Discovery can be resource intensive: stopDiscovery should be called as soon as possible.
— Chrome, bluetooth
system.*.getInfo() and storage
Section titled “system.*.getInfo() and storage”system.cpu.getInfo(), system.display.getInfo(), system.memory.getInfo(), and system.storage.getInfo() return platform snapshots. system.storage.getAvailableCapacity() is noted as Dev channel in the reference—do not depend on it in production without verifying availability.
Printers and print jobs
Section titled “Printers and print jobs”printing.getPrinters() lists manual, enterprise, and discovered printers. printingMetrics.getPrintJobs() returns finished print jobs only.
Runtime, manifest, and “who am I” getters
Section titled “Runtime, manifest, and “who am I” getters”Enumeration often starts from the running extension itself.
runtime.getManifest() and runtime.getURL()
Section titled “runtime.getManifest() and runtime.getURL()”getManifest() serializes the full manifest. getURL() turns a package-relative path into a fully qualified URL. MV2 still documents deprecated chrome.extension.getURL() with guidance to use runtime.getURL instead.
management.getSelf() without the management permission
Section titled “management.getSelf() without the management permission”getSelf() returns ExtensionInfo for the caller.
Note: This function can be used without requesting the ‘management’ permission in the manifest.
— Chrome, management
getPermissionWarningsByManifest() can also run without the management permission—useful when validating a manifest string before install.
Platform and package introspection
Section titled “Platform and package introspection”runtime.getPlatformInfo() describes the OS and CPU architecture. getPackageDirectoryEntry() is foreground only and returns a DirectoryEntry for the package directory.
permissions: check, list, and request
Section titled “permissions: check, list, and request”The permissions API is the supported way to test and expand access at runtime.
| Method | Role |
|---|---|
contains() |
Promise<boolean> whether specified permissions are already granted |
getAll() |
Current permission set |
request() |
Prompt user; must align with optional_permissions or withheld required permissions |
Paths on origin patterns will be ignored. You can request subsets of optional origin permissions; for example, if you specify :///* in the optional_permissions section of the manifest, you can request http://example.com/.
— Chrome, permissions
If request() fails, the promise is rejected—handle that separately from contains() returning false.
DevTools, downloads UI, and enterprise-only readers
Section titled “DevTools, downloads UI, and enterprise-only readers”DevTools inspection helpers
Section titled “DevTools inspection helpers”devtools.inspectedWindow.getResources() lists resources on the inspected page. devtools.network.getHAR() returns a HAR object of known network requests. These only apply in DevTools extension contexts documented on those pages.
Download shelf vs setUiOptions
Section titled “Download shelf vs setUiOptions”downloads.setShelfEnabled() is deprecated since Chrome 117; the reference directs you to setUiOptions on the MV2 downloads page. Multiple extensions can disable UI; enabling while another extension disabled it sets runtime.lastError.
Enterprise and affiliated users
Section titled “Enterprise and affiliated users”enterprise.networkingAttributes.getNetworkDetails() fails with runtime.lastError when the user is not affiliated or the device has no network. enterprise.platformKeys.getTokens() documents user and optional system TPM tokens on Chrome OS–class devices. Treat enterprise APIs as policy- and affiliation-gated, not universal desktop APIs.
Identity, i18n, and channel-limited methods
Section titled “Identity, i18n, and channel-limited methods”getProfileUserInfo() needs the identity.email manifest permission; without it, results are empty. It differs from getAccounts(), which is Dev channel only.
i18n.getAcceptLanguages() returns accept-language preferences; getUILanguage() returns the browser UI locale—the reference explicitly says these are not the same.
Tab capture, sessions, and open handles
Section titled “Tab capture, sessions, and open handles”tabCapture.getCapturedTabs() lists tabs with active or pending capture (status not stopped or error)—useful to avoid duplicate capture requests.
sessions.getDevices() lists devices with synced sessions, with an optional filter.
Socket-style APIs (sockets.tcp.getSockets(), bluetoothSocket.getSockets(), etc.) list open handles owned by the calling app, not every socket on the system.
requestUpdateCheck() and other non-list getters called like utilities
Section titled “requestUpdateCheck() and other non-list getters called like utilities”Not every getter enumerates data. runtime.requestUpdateCheck() triggers an immediate update check, but the reference discourages routine use:
Important: Most extensions/apps should not use this method, since Chrome already does automatic checks every few hours, and you can listen for the runtime.onUpdateAvailable event without needing to call requestUpdateCheck.
— Chrome, runtime
Prefer event-driven update handling unless a backend has proven the client is far out of date.
Content Indexing getAll() (service worker context)
Section titled “Content Indexing getAll() (service worker context)”Separately from chrome.* / browser.*, offline-capable sites can list content index entries:
The getAll() method returns a promise for an iterable list of indexed entries and their metadata. Returned entries will contain all of the data saved with add().
— Chrome, Content Indexing API
That getAll() lives on registration.index, not on extension namespaces, but follows the same “list what we already stored” pattern.
Storage keys: StorageArea.getKeys()
Section titled “Storage keys: StorageArea.getKeys()”chrome.storage.StorageArea.getKeys() (Chrome 130+) returns all keys in a storage area—another enumeration helper alongside reading values.
Gets all keys from storage.
— Chrome, StorageArea
Common mistakes when calling list APIs
Section titled “Common mistakes when calling list APIs”- Assuming one
getAll()fits all — always use the namespace documented for your feature (alarms vs notifications vs permissions). - Missing manifest permissions — e.g. downloads.setShelfEnabled() requires
downloadsanddownloads.shelf; enterprise readers need correct policy and affiliation. - Ignoring
runtime.lastError— enterprise networking, file system provider mount/unmount, and multi-extension download UI all document error reasons vialastError. - Calling discovery APIs without stopping — Bluetooth discovery should pair with stopDiscovery().
- Using Dev-channel-only APIs in release builds —
identity.getAccounts(), somesystem.storagehelpers, and similar entries are labeled Dev channel in the reference. - User gesture requirements — management.setEnabled() and usb.getUserSelectedDevices() document gesture or prompt requirements; calling from background timers fails or no-ops.
How to check this on your site
Section titled “How to check this on your site”-
Load your extension unpacked at
chrome://extensions, confirm the manifest permissions match the APIs you call (permissions reference). -
In the extension service worker or background page, call the relevant list method (for example
permissions.getAll()oralarms.getAll()) and log the resolved value; rejections andchrome.runtime.lastErrorshould match the conditions on that API’s reference page. -
For DevTools extension APIs, open DevTools with your extension enabled and verify getResources() or getHAR() in the documented context only.
-
Compare your calls against the current
browser.*reference URL for each API—not only MV2 samples—so promise signatures and deprecation notes (downloads) stay accurate. -
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 something on this page does not match the linked Chrome reference or you need a clarification, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.