Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/crxjs/chrome-extension-tools/llms.txt

Use this file to discover all available pages before exploring further.

The ManifestV3 interface provides comprehensive TypeScript typings for Chrome Extension Manifest Version 3, including support for both Chrome and Firefox-specific features.

Import

import type { ManifestV3 } from '@crxjs/vite-plugin'

Required Fields

manifest_version
number
required
Must be 3 for Manifest V3 extensions
name
string
required
The name of your extension (45 characters max recommended)
version
string
required
Version string with 1-4 dot-separated integers (e.g., "1.0.0")
description
string
A plain text description of the extension (132 characters max recommended)
icons
chrome.runtime.ManifestIcons
Icon files for your extension in various sizes
{
  "16": "icons/icon16.png",
  "48": "icons/icon48.png",
  "128": "icons/icon128.png"
}
default_locale
string
Locale for _locales directory (e.g., "en")

Background Scripts

background
ChromeManifestBackground | FirefoxManifestBackground
Background service worker configuration

Chrome Background (Service Worker)

interface ChromeManifestBackground {
  service_worker: string
  type?: 'module' | string  // Use 'module' for ES modules
}
{
  "background": {
    "service_worker": "src/background.ts",
    "type": "module"
  }
}

Firefox Background (Scripts)

interface FirefoxManifestBackground {
  scripts: string[]
  persistent?: false
}
{
  "background": {
    "scripts": ["src/background.ts"],
    "persistent": false
  }
}

Content Scripts

content_scripts
ContentScript[]
Array of content script configurations
interface ContentScript {
  matches?: string[]              // URL patterns
  exclude_matches?: string[]      // Excluded URL patterns
  css?: string[]                  // CSS files to inject
  js?: string[]                   // JavaScript files to inject
  run_at?: string                 // 'document_start' | 'document_end' | 'document_idle'
  all_frames?: boolean            // Inject into all frames
  match_about_blank?: boolean     // Match about:blank
  include_globs?: string[]        // Glob patterns to include
  exclude_globs?: string[]        // Glob patterns to exclude
  world?: chrome.scripting.ExecutionWorld | string  // 'ISOLATED' | 'MAIN'
}

Permissions

permissions
chrome.runtime.ManifestPermissions[] | string[]
Array of permission strings (e.g., ["storage", "tabs"])
optional_permissions
chrome.runtime.ManifestPermissions[] | string[]
Permissions that can be requested at runtime
host_permissions
string[]
URL patterns for host access (e.g., ["https://*.example.com/*"])
optional_host_permissions
string[]
Optional host permissions that can be requested at runtime

User Interface

action
chrome.runtime.ManifestAction
Configuration for the extension’s toolbar action (popup, icon, etc.)
options_page
string
Path to the options page (legacy, use options_ui instead)
options_ui
OptionsUI
Configuration for the options page
interface OptionsUI {
  page?: string
  chrome_style?: boolean
  open_in_tab?: boolean
}
side_panel
SidePanel
Configuration for Chrome’s side panel
interface SidePanel {
  default_path?: string
}
devtools_page
string
Path to the DevTools page

Web Accessible Resources

web_accessible_resources
(WebAccessibleResourceById | WebAccessibleResourceByMatch)[]
Resources that can be accessed by web pages or other extensions

By Match Pattern

interface WebAccessibleResourceByMatch {
  matches: string[]              // URL patterns that can access resources
  resources: string[]            // Resource paths
  use_dynamic_url?: boolean      // Use dynamic URLs for resources
}

By Extension ID

interface WebAccessibleResourceById {
  extension_ids: string[]        // Extension IDs that can access resources
  resources: string[]            // Resource paths
  use_dynamic_url?: boolean      // Use dynamic URLs for resources
}

Declarative Net Request

declarative_net_request
DeclarativeNetRequest
Configuration for declarative net request rules
interface DeclarativeNetRequest {
  rule_resources: DeclarativeNetRequestResource[]
}

interface DeclarativeNetRequestResource {
  id: string
  enabled: boolean
  path: string  // Path to JSON rules file
}

Content Security Policy

content_security_policy
ContentSecurityPolicy
CSP configuration for extension pages
interface ContentSecurityPolicy {
  extension_pages?: string
  sandbox?: string
}

Commands

commands
Record<string, Command>
Keyboard shortcuts for your extension
interface Command {
  suggested_key?: {
    default?: string
    windows?: string
    mac?: string
    chromeos?: string
    linux?: string
  }
  description?: string
  global?: boolean
}

Chrome Overrides

chrome_url_overrides
ChromeUrlOverrides
Override Chrome’s built-in pages
interface ChromeUrlOverrides {
  bookmarks?: string   // Override bookmarks page
  history?: string     // Override history page
  newtab?: string      // Override new tab page
}
chrome_settings_overrides
ChromeSettingsOverrides
Override Chrome settings
interface ChromeSettingsOverrides {
  homepage?: string
  search_provider?: chrome.runtime.SearchProvider
  startup_pages?: string[]
}

Firefox-Specific

browser_specific_settings
BrowserSpecificSettings
Firefox-specific settings including extension ID and version requirements
interface BrowserSpecificSettings {
  gecko: {
    id: string                          // Extension ID (required for Firefox)
    strict_min_version?: string         // Minimum Firefox version
    strict_max_version?: string         // Maximum Firefox version
    update_url?: string                 // Custom update URL
    data_collection_permissions: {
      required: GeckoPermissionsRequired[]
      optional?: GeckoPermissionsOptional[]
    }
  }
}

Other Fields

author
{ email: string }
Extension author information
homepage_url
string
URL to the extension’s homepage
short_name
string
Short name for the extension (12 characters max recommended)
version_name
string
Human-readable version string (e.g., "1.0 beta")
minimum_chrome_version
string
Minimum Chrome version required
key
string
Public key for the extension ID
update_url
string
URL for extension updates
omnibox
{ keyword: string }
Register a keyword for the omnibox
externally_connectable
ExternallyConnectable
Configure external messaging connections
interface ExternallyConnectable {
  ids?: string[]                    // Extension IDs
  matches?: string[]                // URL patterns
  accepts_tls_channel_id?: boolean
}
storage
{ managed_schema: string }
Path to managed storage schema
incognito
string
Incognito mode behavior: "spanning", "split", or "not_allowed"
offline_enabled
boolean
Whether the extension works offline

Example Manifest

{
  "manifest_version": 3,
  "name": "My Extension",
  "version": "1.0.0",
  "description": "A sample Chrome extension",
  "icons": {
    "16": "icons/icon16.png",
    "48": "icons/icon48.png",
    "128": "icons/icon128.png"
  },
  "action": {
    "default_popup": "src/popup.html",
    "default_icon": {
      "16": "icons/icon16.png",
      "48": "icons/icon48.png"
    }
  },
  "background": {
    "service_worker": "src/background.ts",
    "type": "module"
  },
  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["src/content.ts"],
      "run_at": "document_idle"
    }
  ],
  "permissions": [
    "storage",
    "tabs"
  ],
  "host_permissions": [
    "https://*.example.com/*"
  ]
}

Build docs developers (and LLMs) love