Chrome Extension Manifest Reference — Developer Guide

3 min read

manifest.json Complete Reference

Introduction

Required Fields

Background Service Worker

"background": {
  "service_worker": "background.js",
  "type": "module"
}

Content Scripts

"content_scripts": [{
  "matches": ["https://*.example.com/*"],
  "js": ["content.js"],
  "css": ["styles.css"],
  "run_at": "document_idle"
}]

Action (Toolbar Button)

"action": {
  "default_popup": "popup.html",
  "default_icon": { "16": "icon16.png", "32": "icon32.png" },
  "default_title": "Click me"
}

Permissions

"permissions": ["storage", "activeTab", "alarms"],
"optional_permissions": ["tabs", "bookmarks"],
"host_permissions": ["https://*.example.com/*"]

Options Page

"options_ui": {
  "page": "options.html",
  "open_in_tab": true
}

Web Accessible Resources

"web_accessible_resources": [{
  "resources": ["images/*.png", "styles.css"],
  "matches": ["https://*.example.com/*"]
}]

Commands (Keyboard Shortcuts)

"commands": {
  "_execute_action": {
    "suggested_key": { "default": "Ctrl+Shift+Y" },
    "description": "Open popup"
  }
}

Content Security Policy

"content_security_policy": {
  "extension_pages": "script-src 'self'; object-src 'self'"
}

Internationalization

Other Fields

Common Mistakes

Part of the Chrome Extension Guide by theluckystrike. Built at zovo.one.