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
Must be 3 for Manifest V3 extensions
The name of your extension (45 characters max recommended)
Version string with 1-4 dot-separated integers (e.g., "1.0.0")
Recommended Fields
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"
}
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
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
URL patterns for host access (e.g., ["https://*.example.com/*"])
optional_host_permissions
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.)
Path to the options page (legacy, use options_ui instead)
Configuration for the options pageinterface OptionsUI {
page?: string
chrome_style?: boolean
open_in_tab?: boolean
}
Configuration for Chrome’s side panelinterface SidePanel {
default_path?: 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
Configuration for declarative net request rulesinterface DeclarativeNetRequest {
rule_resources: DeclarativeNetRequestResource[]
}
interface DeclarativeNetRequestResource {
id: string
enabled: boolean
path: string // Path to JSON rules file
}
Content Security Policy
CSP configuration for extension pagesinterface ContentSecurityPolicy {
extension_pages?: string
sandbox?: string
}
Commands
Keyboard shortcuts for your extensioninterface Command {
suggested_key?: {
default?: string
windows?: string
mac?: string
chromeos?: string
linux?: string
}
description?: string
global?: boolean
}
Chrome Overrides
Override Chrome’s built-in pagesinterface ChromeUrlOverrides {
bookmarks?: string // Override bookmarks page
history?: string // Override history page
newtab?: string // Override new tab page
}
chrome_settings_overrides
Override Chrome settingsinterface ChromeSettingsOverrides {
homepage?: string
search_provider?: chrome.runtime.SearchProvider
startup_pages?: string[]
}
Firefox-Specific
browser_specific_settings
Firefox-specific settings including extension ID and version requirementsinterface 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
Extension author information
URL to the extension’s homepage
Short name for the extension (12 characters max recommended)
Human-readable version string (e.g., "1.0 beta")
Minimum Chrome version required
Public key for the extension ID
URL for extension updates
Register a keyword for the omnibox
Configure external messaging connectionsinterface ExternallyConnectable {
ids?: string[] // Extension IDs
matches?: string[] // URL patterns
accepts_tls_channel_id?: boolean
}
storage
{ managed_schema: string }
Path to managed storage schema
Incognito mode behavior: "spanning", "split", or "not_allowed"
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/*"
]
}