欢迎使用扩展程序!
YouTube 上的扩展程序
Chrome 应用商店背后的故事:向产品经理提问
什么是内容脚本?
什么是远程托管代码?
扩展程序实例
Action API 演示
UserScript API 演示
Scripting API 演示
SidePanel API 演示
附加信息帖子
chrome.contentSettings
使用 chrome.contentSettings API 更改用于控制网站是否可以使用 Cookie、JavaScript 和插件等功能的设置。更一般地说,内容设置可让您针对每个网站(而非全局)自定义 Chrome 的行为。 您必须在扩展程序的清单中声明“contentSettings”权限,才能使用该 API。例如: 您可以使用模式来指定每项内容设置影响的网站。例如, https://*.youtube.com/* 指定了 youtube.com 及其所有子网域。内容设置模式的语法与
chrome.printing
使用 chrome.printing API 将打印作业发送到安装在 Chromebook 上的打印机。 您需要在 扩展程序清单 中声明 "printing" 权限,才能使用所有 chrome.printing 方法和事件。例如: 以下示例演示了如何使用打印命名空间中的每种方法。此代码复制自或基于 extensions-samples GitHub 代码库中的 api-samples/printing 。 以下示例使用 onJobStatusChanged 处理脚本来在 jobStatus
chrome.userScripts
使用 userScripts API 在“用户脚本”上下文中执行用户脚本。 如需使用 User Scripts API ( chrome.userScripts ),请将 "userScripts" 权限添加到 manifest.json,并为您要运行脚本的网站添加 "host_permissions" 。 用户脚本是指注入到网页中用于修改其外观或行为的一小段代码。与其他扩展程序功能(例如 内容脚本 和 chrome.scripting API )不同,用户脚本 API
chrome.sessions
使用 chrome.sessions API 查询和恢复浏览会话中的标签页和窗口。 字符串 外部设备的名称。 会话 [] 外部设备的打开窗口会话列表,按修改时间从最近到最久排序。 编号(可选) 要从请求的列表中提取的条目数量上限。省略此参数可提取最大条目数 ( sessions.MAX_SESSION_RESULTS )。 数值 窗口或标签页关闭或修改的时间,以自公元纪年开始计算的秒数表示。 标签页 (可选) tabs.Tab (如果此条目描述的是标签页)。系统会设置此值或
chrome.printing
使用 chrome.printing API 将打印作业发送到安装在 Chromebook 上的打印机。 您需要在 扩展程序清单 中声明 "printing" 权限,才能使用所有 chrome.printing 方法和事件。例如: 以下示例演示了如何使用打印命名空间中的每种方法。此代码复制自 extensions-samples GitHub 代码库中的 api-samples/printing ,或基于该代码库。 以下示例使用 onJobStatusChanged 处理脚本来在
chrome.sessions
使用 chrome.sessions API 查询和恢复浏览会话中的标签页和窗口。 字符串 外部设备的名称。 会话 [] 外部设备的打开窗口会话列表,按修改时间从最近到最久排序。 编号(可选) 要从请求的列表中提取的条目数量上限。省略此参数可提取最大条目数 ( sessions.MAX_SESSION_RESULTS )。 数值 窗口或标签页关闭或修改的时间,以自公元纪年开始计算的秒数表示。 标签页 (可选) tabs.Tab (如果此条目描述的是标签页)。系统会设置此值或
chrome.contentSettings
使用 chrome.contentSettings API 更改用于控制网站是否可以使用 Cookie、JavaScript 和插件等功能的设置。更一般地说,内容设置可让您针对每个网站(而非全局)自定义 Chrome 的行为。 您必须在扩展程序的清单中声明 "contentSettings" 权限,才能使用该 API。例如: 您可以使用模式来指定每项内容设置影响的网站。例如, https://*.youtube.com/* 指定了 youtube.com 及其所有子网域。内容设置模式的语法与
chrome.i18n
使用 chrome.i18n 基础架构在整个应用或扩展程序中实现国际化。 如果扩展程序包含 /_locales 目录,则 manifest 必须定义 "default_locale" 。 您需要将其所有面向用户的字符串放入名为 messages.json 的文件中。每次添加新的语言区域时,您都需要在名为 /_locales/_localeCode_ 的目录下添加一个消息文件,其中 localeCode 是一个代码,例如英语的代码为 en 。 以下是支持英语 ( en )、西班牙语 ( es )
chrome.storage
使用 chrome.storage API 存储、检索和跟踪用户数据的更改。 如需使用 Storage API,请在扩展程序 manifest 中声明 "storage" 权限。例如: Storage API 提供了一种扩展程序专用的方法来保留用户数据和状态。它与 Web 平台的存储 API( IndexedDB 和 Storage )类似,但旨在满足扩展程序的存储需求。以下是一些关键功能: 虽然扩展程序可以在某些上下文(弹出式窗口和其他 HTML 页面)中使用 Storage 接口(可通过
chrome.storage
使用 chrome.storage API 存储、检索和跟踪用户数据的更改。 Storage API 提供了一种扩展程序专用的方法来保留用户数据和状态。它类似于 Web 平台的存储 API( IndexedDB 和 Storage ),但旨在满足扩展程序的存储需求。以下是一些关键功能: 虽然扩展程序可以在某些上下文(弹出式窗口和其他 HTML 页面)中使用 [ Storage ][mdn-storage] 接口(可通过 window.localStorage
扩展程序 / 开始使用
开始使用 Chrome 扩展程序的所有基本知识
chrome.enterprise.platformKeys
使用 chrome.enterprise.platformKeys API 生成密钥并为这些密钥安装证书。证书将由平台管理,可用于 TLS 身份验证、网络访问,或由其他扩展程序通过 chrome.platformKeys 使用。 如需使用此 API 注册客户端证书,请按以下步骤操作: 使用 enterprise.platformKeys.getTokens 获取所有可用令牌。 找到 id 等于 "user" 的令牌。之后使用此令牌。 使用 generateKey 令牌方法(在
chrome.enterprise.platformKeys
使用 chrome.enterprise.platformKeys API 生成密钥并为这些密钥安装证书。证书将由平台管理,可用于 TLS 身份验证、网络访问,或由其他扩展程序通过 chrome.platformKeys 使用。 如需使用此 API 注册客户端证书,请按以下步骤操作: 使用 enterprise.platformKeys.getTokens() 获取所有可用令牌。 找到 id 等于 "user" 的令牌。之后使用此令牌。 使用 generateKey() 令牌方法(在
chrome.runtime
使用 chrome.runtime API 检索服务工件、返回清单的详细信息,以及监听和响应扩展程序生命周期中的事件。您还可以使用此 API 将网址的相对路径转换为完全限定网址。 Runtime API 提供了多种方法来支持您的扩展程序可使用的多种功能领域: 运行时 API 上的大多数方法 不需要 任何权限,但 sendNativeMessage 和 connectNative 需要 nativeMessaging 权限。 以下示例展示了如何在清单中声明 nativeMessaging 权限:
chrome.permissions
使用 chrome.permissions API 在运行时(而不是安装时)请求 声明的可选权限 ,以便用户了解需要这些权限的原因,并仅授予必要的权限。 权限警告旨在说明 API 授予的功能,但其中一些警告可能并不明显。借助 Permissions API,开发者可以解释权限警告并逐步引入新功能,让用户能够无风险地了解扩展程序。这样,用户可以指定他们愿意授予的访问权限级别以及想要启用的功能。 例如, 可选权限扩展程序 的核心功能会替换新标签页。其中一个功能是显示用户当天的目标。此功能仅需要
chrome.permissions
使用 chrome.permissions API 在运行时(而不是安装时)请求 声明的可选权限 ,以便用户了解需要这些权限的原因,并仅授予必要的权限。 权限警告旨在说明 API 授予的功能,但其中一些警告可能并不明显。借助 Permissions API,开发者可以解释权限警告并逐步引入新功能,让用户能够无风险地了解扩展程序。这样,用户可以指定他们愿意授予的访问权限级别以及他们想要启用的功能。 例如, 可选权限扩展程序 的核心功能会替换新标签页。其中一个功能是显示用户当天的目标。此功能仅需要
2025 年 1 月 Chrome 扩展程序的变化
概要介绍 Chrome 扩展程序近期的变化,以及开发者可以期待的即将推出的扩展程序功能。
chrome.bookmarks
使用 chrome.bookmarks API 创建、整理和以其他方式处理书签。另请参阅 替换页面 ,您可以使用该页面创建自定义书签管理器页面。 您必须在 扩展程序清单 中声明“书签”权限,才能使用 Bookmarks API。例如: 书签以树状结构进行整理,其中树中的每个节点都是一个书签或文件夹(有时称为 组 )。树中的每个节点都由 bookmarks.BookmarkTreeNode 对象表示。 BookmarkTreeNode 属性在整个 chrome.bookmarks API
chrome.bookmarks
此权限会 触发警告 。 使用 chrome.bookmarks API 创建、整理和以其他方式处理书签。另请参阅 替换页面 ,您可以使用该页面创建自定义书签管理器页面。 您必须在 扩展程序清单 中声明“书签”权限,才能使用 Bookmarks API。例如: 书签以树状结构进行整理,其中树中的每个节点都是一个书签或文件夹(有时称为 组 )。树中的每个节点都由 bookmarks.BookmarkTreeNode 对象表示。 BookmarkTreeNode 属性在整个
Chrome 应用商店政策更新:确保向开发者提供清晰且一致的信息
Chrome 应用商店致力于为开发者和用户打造优质且值得信赖的生态系统。为实现这一目标,我们将宣布一系列政策更新,以确保在整个 YouTube 平台上做到清晰明确和一致。这些更新涉及功能、内容标准和开发者指南的关键领域。 我们正在简化 申诉流程 ,以提高效率并提高透明度。今后,对于每项违反政策的行为,开发者只能提出一次申诉。判定结果确定后,开发者将无法重新提出申诉。 为了与更广泛的 Google 产品政策保持一致,我们将更新 用词 ,明确禁止在 Chrome
chrome.tabs
使用 chrome.tabs API 与浏览器的标签页系统进行交互。您可以使用此 API 在浏览器中创建、修改和重新排列标签页。 Tabs API 不仅提供用于操作和管理标签页的功能,还可以检测标签页的 语言 、截取 屏幕截图 ,以及与标签页的内容脚本进行 通信 。 大多数功能无需任何权限即可使用。例如: 创建 新标签页、 重新加载 标签页、 导航 到其他网址等。 开发者在使用 Tabs API 时应注意三项权限。 此权限不会授予对 chrome.tabs
chrome.tabs
使用 chrome.tabs API 与浏览器的标签页系统进行交互。您可以使用此 API 在浏览器中创建、修改和重新排列标签页。 Tabs API 不仅提供用于操作和管理标签页的功能,还可以检测标签页的 语言 、截取 屏幕截图 ,以及与标签页的内容脚本进行 通信 。 大多数功能无需任何权限即可使用。例如: 创建 新标签页、 重新加载 标签页、 导航 到其他网址等。 开发者在使用 Tabs API 时应注意三项权限。 以下示例展示了如何在 manifest 中声明每项权限:
chrome.ttsEngine
使用 chrome.ttsEngine API 通过扩展程序实现文本转语音(TTS) 引擎。如果您的扩展程序使用此 API 进行注册,那么当任何扩展程序或 Chrome 应用使用 tts API 生成语音时,该扩展程序将会收到包含要朗读的语音和其他参数的事件。然后,您的扩展程序可以使用任何可用的 Web 技术来合成和输出语音,并将事件发送回调用函数以报告状态。 扩展程序可以将自己注册为语音引擎。这样,它就可以拦截对 tts.speak() 和 tts.stop()
chrome.cookies
使用 chrome.cookies API 查询和修改 Cookie,并在 Cookie 发生更改时收到通知。 如需使用 Cookie API,您必须在清单中声明“Cookie”权限,以及您要访问 Cookie 的所有主机的 主机权限 。例如: 借助 分区 Cookie ,网站可以标记某些 Cookie 应采用顶级框架的来源作为键。这意味着,如果网站 A 使用 iframe 嵌入到网站 B 和网站 C 中,则分区 Cookie 在每个网站中可以具有不同的值。 chrome.cookies
chrome.ttsEngine
使用 chrome.ttsEngine API 通过扩展程序实现文本转语音(TTS) 引擎。如果您的扩展程序使用此 API 进行注册,那么当任何扩展程序或 Chrome 应用使用 tts API 生成语音时,该扩展程序将收到包含要朗读的语音和其他参数的事件。然后,您的扩展程序可以使用任何可用的 Web 技术来合成和输出语音,并将事件发送回调用函数以报告状态。 扩展程序可以将自己注册为语音引擎。这样一来,它就可以拦截对 tts.speak 和 tts.stop
chrome.cookies
使用 chrome.cookies API 查询和修改 Cookie,并在 Cookie 发生更改时收到通知。 如需使用 Cookie API,请在清单中声明 "cookies" 权限,并为您要访问 Cookie 的所有主机声明 主机权限 。例如: 借助 分区 Cookie ,网站可以标记某些 Cookie 应采用顶级框架的来源作为键。例如,这意味着,如果网站 A 使用 iframe 嵌入到网站 B 和网站 C 中,则来自 A 的分区 Cookie 的嵌入版本在 B 和 C 中可以具有不同的值。
Chrome 扩展程序的新变化
Chrome 扩展程序平台、文档和政策近期的变化
chrome.certificateProvider
使用此 API 将证书公开给平台,平台可以使用这些证书进行 TLS 身份验证。 如需使用此 API 向 ChromeOS 公开客户端证书,请按以下步骤操作: 实际步骤顺序可能会有所不同。例如,如果使用用于自动选择证书的企业政策,系统将不会要求用户选择证书(请参阅 AutoSelectCertificateForUrls 和 面向用户的 Chrome 政策 )。 在扩展程序中,这可能类似于以下代码段: 支持的加密签名算法类型。 "RSASSA_PKCS1_v1_5_MD5_SHA1" 使用
chrome.extension
chrome.extension API 包含可供任何扩展程序页面使用的实用程序。它支持在扩展程序及其内容脚本之间或扩展程序之间交换消息,如 消息传递 中所详述。 扩展程序视图的类型。 "tab" "popup" 对于在无痕式标签页中运行的内容脚本,以及在无痕式进程中运行的扩展程序页面,此值为 true。后者仅适用于具有“split”incognito_behavior 的扩展程序。 布尔值 返回当前扩展程序中运行的后台页面的
chrome.system.display
使用 system.display API 查询显示元数据。 一个枚举,用于指明系统是否检测到显示屏并使用了显示屏。如果系统未检测到显示屏(可能已断开连接,或因进入休眠模式等原因而被视为已断开连接),则系统会将显示屏视为“非活跃”。例如,此状态用于在所有显示屏断开连接时保留现有显示屏。 "active" "inactive" 数值 显示屏的高度(以像素为单位)。 数值 左上角的 x 坐标。 数值 左上角的 y 坐标。 数值 显示屏的宽度(以像素为单位)。 字符串 显示屏的唯一标识符。 数值
chrome.system.display
使用 system.display API 查询显示元数据。 一个枚举,用于指明系统是否检测到显示屏并使用了显示屏。如果系统未检测到显示屏(可能已断开连接,或因进入休眠模式等原因而被视为已断开连接),则系统会将显示屏视为“非活跃”。例如,此状态用于在所有显示屏断开连接时保留现有显示屏。 "active" "inactive" 数值 显示屏的高度(以像素为单位)。 数值 左上角的 x 坐标。 数值 左上角的 y 坐标。 数值 显示屏的宽度(以像素为单位)。 字符串 显示屏的唯一标识符。 数值
chrome.action
使用 chrome.action API 控制 Google Chrome 工具栏中的扩展程序图标。 必须在 清单 中声明以下键才能使用此 API。 如需使用 chrome.action API,请指定 3 的 "manifest_version" ,并在 清单文件 中添加 "action" 键。 "action" 键(及其子项)是可选的。如果未包含该图标,您的扩展程序仍会显示在工具栏中,以便用户访问扩展程序的菜单。因此,我们建议您始终至少添加 "action" 和 "default_icon"
chrome.commands
使用 Commands API 添加可在扩展程序中触发操作的键盘快捷键,例如用于打开浏览器操作或向扩展程序发送命令的操作。 必须在 清单 中声明以下键才能使用此 API。 借助 Commands API,扩展程序开发者可以定义特定命令,并将其绑定到默认的按键组合。扩展程序接受的每个命令都必须在 扩展程序清单 中声明为 "commands" 对象的属性。 属性键将用作命令的名称。命令对象可以采用两个属性。
chrome.certificateProvider
使用此 API 将证书公开给平台,平台可以使用这些证书进行 TLS 身份验证。 如需使用此 API 向 ChromeOS 公开客户端证书,请按以下步骤操作: 实际步骤顺序可能会有所不同。例如,如果使用自动选择证书的企业政策,系统就不会要求用户选择证书(请参阅 AutoSelectCertificateForUrls 和 面向用户的 Chrome 政策 )。 在扩展程序中,这可能类似于以下代码段: 支持的加密签名算法类型。 "RSASSA_PKCS1_v1_5_MD5_SHA1" 使用
chrome.extension
chrome.extension API 包含可供任何扩展程序页面使用的实用程序。它支持在扩展程序及其内容脚本之间或扩展程序之间交换消息,如 消息传递 中所详述。 扩展程序视图的类型。 "tab" "popup" 对于在无痕式标签页中运行的内容脚本,以及在无痕式进程中运行的扩展程序页面,此值为 true。后者仅适用于具有“split”incognito_behavior 的扩展程序。 布尔值 请使用 runtime.lastError 。 如果异步扩展程序 API
chrome.fontSettings
使用 chrome.fontSettings API 管理 Chrome 的字体设置。 如需使用 Font Settings API,您必须在 扩展程序清单 中声明 "fontSettings" 权限。例如: Chrome 允许某些字体设置取决于某些通用字体系列和语言脚本。例如,用于 sans-serif 简体中文的字体可能与用于 serif 日语的字体不同。 Chrome 支持的通用字体系列基于 CSS 通用字体系列 ,并在 GenericReference
扩展程序和 AI
了解如何利用 AI 技术开发扩展程序
chrome.desktopCapture
Desktop Capture API 可截取屏幕、单个窗口或单个标签页的内容。 用于定义 chooseDesktopMedia() 中使用的一组桌面媒体来源的枚举。 "screen" "window" "tab" "audio" 镜像 SelfCapturePreferenceEnum 。 "include" "exclude" 镜像 SystemAudioPreferenceEnum 。 "include" "exclude" 隐藏由 chooseDesktopMedia()
chrome.documentScan
使用 chrome.documentScan API 从连接的文件扫描器中发现和检索图片。
chrome.dns
使用 chrome.dns API 进行 DNS 解析。 如需使用此 API,您必须在 manifest 中声明 "dns" 权限。 以下代码调用 resolve() 以检索 example.com 的 IP 地址。 service-worker.js : 字符串(选填) 表示 IP 地址字面量的字符串。仅当 resultCode 表示成功时才提供。 数值 结果代码。零表示成功。 解析给定的主机名或 IP 地址字面量。 字符串 要解析的主机名。 函数(可选) callback 参数如下所示:
chrome.declarativeContent
使用 chrome.declarativeContent API 可根据网页内容执行操作,而无需拥有读取网页内容的权限。 借助声明式内容 API,您可以根据网页的网址或 CSS 选择器是否与网页上的元素匹配来启用扩展程序的操作,而无需添加 主机权限 或注入 内容脚本 。 使用 activeTab 权限可在用户点击扩展程序的操作后与网页互动。 规则由条件和操作组成。如果满足其中任一条件,系统就会执行所有操作。相应操作分别为 setIcon() 和 showAction() 。
chrome.system.storage
使用 chrome.system.storage API 查询存储设备信息,并在可拆卸存储设备连接和断开连接时收到通知。 “success” 弹出命令已成功执行 - 应用可以提示用户移除设备。 "in_use" 设备正被其他应用使用。弹出操作未成功;在其他应用使用完设备之前,用户不应移除设备。 "no_such_device" 未知有此类设备。 “failure” 弹出命令失败。 数值 存储设备的可用容量(以字节为单位)。 字符串 getAvailableCapacity 函数参数 id 的复制
chrome.alarms
使用 chrome.alarms API 可安排代码定期运行或在未来的指定时间运行。 如需使用 chrome.alarms API,请在 manifest 中声明 "alarms" 权限: 为了确保可靠的行为,了解 API 的行为方式会很有帮助。 闹钟会在设备处于休眠状态时继续运行。不过,闹钟不会唤醒设备。设备唤醒后,所有错过的闹钟都会响铃。 重复闹钟最多会触发一次,然后系统会从设备唤醒时开始,使用指定的间隔时间重新安排闹钟,而不考虑闹钟最初设置为运行时已经经过的时间。
chrome.contextMenus
使用 chrome.contextMenus API 可向 Google Chrome 的上下文菜单添加项。您可以选择要将上下文菜单项应用于哪些类型的对象,例如图片、超链接和网页。 您必须在扩展程序的清单中声明 "contextMenus" 权限,才能使用该 API。此外,您还应指定一个 16 x 16 像素的图标,以便在菜单项旁边显示。例如: 上下文菜单项可显示在任何文档(或文档中的框架)中,即使是使用 file:// 或 chrome://
chrome.audio
chrome.audio API 的提供是为了让用户能够获取有关连接到系统的音频设备的信息并控制这些设备。此 API 目前仅适用于 ChromeOS 的自助服务终端模式。 字符串 设备名称。 DeviceType 设备类型。 字符串 简单易懂的名称(例如“USB 麦克风”)。 字符串 音频设备的唯一标识符。 布尔值 如果这是当前处于活动状态的设备,则为 true。 数值 设备的音量、输出音量、输入增益。 字符串(选填) 稳定/持久的设备 ID 字符串(如果有)。 StreamType
chrome.declarativeNetRequest
chrome.declarativeNetRequest API 用于通过指定声明式规则来屏蔽或修改网络请求。这样,扩展程序就可以修改网络请求,而无需拦截和查看其内容,从而提供更高的隐私保护。 “ declarativeNetRequest ”和“ declarativeNetRequestWithHostAccess ”权限提供相同的功能。两者之间的区别在于请求或授予权限的时间。 除了前面介绍的权限之外,某些类型的规则集(尤其是静态规则集)还需要声明
chrome.devtools.panels
使用 chrome.devtools.panels API 将您的扩展程序集成到“开发者工具”窗口界面:创建自己的面板、访问现有面板以及添加边栏。 每个扩展程序面板和边栏都会显示为单独的 HTML 页面。“开发者工具”窗口中显示的所有扩展程序页面都可以访问 chrome.devtools API 的所有部分,以及所有其他扩展程序 API。 您可以使用 devtools.panels.setOpenResourceHandler
chrome.fileBrowserHandler
使用 chrome.fileBrowserHandler API 扩展 ChromeOS 文件浏览器。例如,您可以使用此 API 让用户将文件上传到您的网站。 当用户按 Alt+Shift+M 或连接外部存储设备(例如 SD 卡、USB 密钥、外部驱动器或数码相机)时,ChromeOS 文件浏览器就会弹出。除了显示外部设备上的文件外,文件浏览器还可以显示用户之前保存到系统中的文件。
chrome.readingList
使用 chrome.readingList API 读取和修改 阅读清单 中的项。 如需使用阅读列表 API,请在扩展程序 manifest 文件中添加 "readingList" 权限: manifest.json: Chrome 的侧边栏中提供了阅读清单。借助该功能,用户可以保存网页以供日后阅读或离线阅读。使用 Reading List API 检索现有内容,并在列表中添加或移除内容。 阅读列表中的项目没有固定的顺序。 项按网址键值对进行排序。其中包括哈希和查询字符串。 以下部分展示了
API 参考
针对 Chrome 扩展程序可用的所有 API 的完整参考。这包括适用于已弃用的 Chrome 应用平台的 API,以及仍在测试和开发阶段的 API。
2024 年 10 月 Chrome 扩展程序的变化
概要介绍 Chrome 扩展程序近期的变化,以及开发者可以期待的即将推出的扩展程序功能。
提升 Chrome 应用商店开发者信息中心的移动体验
我们很高兴地宣布,Chrome 应用商店开发者信息中心进行了一系列界面更改,使其响应速度更快,更适合移动设备。我们希望这样能让您在监控商品详情效果、更改商品详情以及管理实体店内扩展程序时获得更便捷的体验。 我们更新了所有图表和分析页面,使其响应速度更快,以便您更好地查看扩展程序在移动设备上的商品详情效果。 您还可以通过移动设备更新商店元数据,包括说明、图片和隐私设置。
chrome.webRequest
使用 chrome.webRequest API 可观察和分析流量,以及拦截、阻止或修改传输中的请求。 您必须在 扩展程序清单 中声明 "webRequest" 权限,才能使用 Web 请求 API 以及必要的 主机权限 。要拦截子资源请求, 扩展程序必须同时有权访问请求的网址及其发起者。例如: webRequestBlocking 必须填写此字段,才能注册屏蔽事件处理脚本。从 Manifest V3 开始, 适用于通过政策安装的扩展程序 webRequestAuthProvider 使用
chrome.sidePanel
使用 chrome.sidePanel API 可将浏览器侧边栏中的内容与网页的主要内容一同托管。 如需使用 Side Panel API,请在扩展程序 清单 文件中添加 "sidePanel" 权限: manifest.json: 借助 Side Panel API,扩展程序可以在侧边栏中显示自己的界面,从而提供持久的体验,补充用户的浏览历程。 部分功能包括: 以下部分介绍了 Side Panel API 的一些常见用例。如需查看完整的扩展程序示例,请参阅 扩展程序示例 。 最初可通过清单的
chrome.omnibox
多功能框 API 可让您向 Chrome 浏览器的地址栏(也称为多功能框)注册关键字。 当该用户输入您扩展程序中的关键字后,便开始只与您的 。每次按键操作都会发送到您的扩展程序,并且您可以在响应中提供建议。 建议可以采用多种格式以各种格式进行显示。当用户接受建议后 您的扩展程序会收到通知,并可以采取相应措施。 您必须在 清单 中添加 omnibox keyword 字段,才能使用多功能框 API。您 还应该指定一个 16x16
chrome.pageAction
使用 chrome.pageAction API 将图标放置在 Google Chrome 主工具栏(地址栏右侧)中。网页操作是指可对当前网页执行,但并不适用于所有网页的操作。处于非活动状态的页面操作会显示为灰色。 一些示例: 以下屏幕截图中的 RSS 图标代表可让您订阅 RSS 的页面操作 Feed。 隐藏的网页操作会显示为灰色。例如,下面的 RSS Feed 是灰显的, 订阅当前页面的 Feed: 请考虑改用 浏览器操作 ,以便用户始终与您的 。 在 扩展程序清单
chrome.windows
使用 chrome.windows API 与浏览器窗口进行交互。您可以使用此 API 在浏览器中创建、修改和重新排列窗口。 收到请求时, windows.Window 会包含一组 tabs.Tab 对象。您必须 如果您需要访问 url ,请在 清单 中声明 "tabs" 权限, tabs.Tab 的 pendingUrl 、 title 或 favIconUrl 属性。例如: 扩展系统中的许多函数都接受可选的 windowId 参数,该参数默认为 。
chrome.i18n
使用 chrome.i18n 基础架构在您的整个应用或扩展程序中实现国际化。 您需要将其所有的用户可见字符串都放入名为 messages.json 的文件中。每次 添加新的语言区域时,请在名为 _locales/_localeCode_ 的目录下添加消息文件,其中 localeCode 是一个代码,例如表示英语的 en 。 以下是支持英语 ( en )、西班牙语的国际化扩展程序的文件层次结构 ( es ) 和韩语 ( ko ): 假设您的扩展程序包含如下图所示的文件:
chrome.browserAction
使用浏览器操作将图标放入 Google Chrome 主工具栏(位于地址栏的右侧)。除了 图标 之外,浏览器操作还可以包含 提示 、 标记 和 弹出式窗口 。 在下图中,地址栏右侧的彩色方块是 。图标下方会显示一个弹出式窗口。 如果您想创建的图标不是始终处于活跃状态,请使用 网页操作 (而不是浏览器) 操作。 在 扩展程序清单 中注册浏览器操作,如下所示: 您可以提供任意尺寸的图标,以便在 Chrome 中使用,Chrome 会选择最接近的图标并进行缩放 将其调整为适当的尺寸,以填充
chrome.webRequest
使用 chrome.webRequest API 可观察和分析流量,以及拦截、阻止或修改传输中的请求。 您必须在 扩展程序清单 中声明 "webRequest" 权限,才能使用 Web 请求 API 以及必要的 主机权限 。要拦截子资源请求, 扩展程序必须同时有权访问请求的网址及其发起者。例如: 从 Chrome 108 开始,如果您使用 "webRequest" 和 "webRequestAuthProvider" ,则可以为 onAuthRequired 事件 异步提供凭据 权限。 Web
chrome.fileBrowserHandler
使用 chrome.fileBrowserHandler API 扩展 Chrome 操作系统的文件浏览器。例如,您可以使用此 API 让用户向您的网站上传文件。 当用户按 Alt+Shift+M 或连接外部存储设备(例如 SD 卡、USB 密钥、外部驱动器或数码相机)时,ChromeOS 文件浏览器将会启动。除了显示外部设备上的文件外,文件浏览器还可以显示用户之前保存到系统的文件。
chrome.devtools.panels
使用 chrome.devtools.panels API 将您的扩展程序集成到开发者工具窗口界面中:创建自己的面板、访问现有面板以及添加边栏。 必须在 清单 中声明以下键才能使用此 API。 有关使用开发者工具 API 的一般说明,请参阅 DevTools API 摘要 。 每个扩展程序面板和边栏都会显示为一个单独的 HTML 网页。已显示所有扩展程序页面 在“开发者工具”窗口中可以访问 chrome.devtools API 中的所有模块,以及 chrome.extension
chrome.system.cpu
使用 system.cpu API 查询 CPU 元数据。 字符串 处理器的架构名称。 字符串[] 一组功能代码,用于表示处理器的部分功能。目前支持的代码包括“mmx”“sse”“sse2”“sse3”“ssse3”“sse4_1”“sse4_2”和“avx”。 字符串 处理器的型号名称。 number 逻辑处理器数量。 ProcessorInfo [] 每个逻辑处理器的相关信息。 数值 [] 来自 CPU 每个热区的 CPU 温度读数列表。温度以摄氏度为单位。 目前仅适用于 ChromeOS。
chrome.enterprise.networkingAttributes
使用 chrome.enterprise.networkingAttributes API 读取有关当前网络的信息。注意:此 API 仅适用于由企业政策强制安装的扩展程序。 字符串(可选) 设备的本地 IPv4 地址(如果未配置,则未定义)。 字符串(可选) 设备的本地 IPv6 地址(如果未配置,则未定义)。 字符串 设备的 MAC 地址。 检索设备默认网络的网络详细信息。如果用户未关联或设备未连接到网络,系统将设置 runtime.lastError 并注明失败原因。 函数(可选)
chrome.input.ime
使用 chrome.input.ime API 为 ChromeOS 实现自定义 IME。这样一来,您的扩展程序就可以处理按键、设置构图和管理候选窗口。 您必须声明“input”权限,以使用 input.ime API。 例如: 以下代码会创建一个 IME,用于将输入的字母转换为大写。 辅助窗口中按钮的 ID。 "撤消" "addToDictionary" 辅助窗口的属性。 字符串(可选) ChromeVox 朗读的字符串。 "撤消" 布尔值 设为 true 以显示
chrome.instanceID
使用 chrome.instanceID 访问实例 ID 服务。 重置应用实例标识符并撤消与其关联的所有令牌。 函数(可选) callback 参数如下所示: 承诺<void> 只有 Manifest V3 及更高版本支持 Promise,其他平台需要使用回调。 撤消已授予的令牌。 对象 deleteToken 的参数。 字符串 用于获取令牌的授权实体。 字符串 用于获取令牌的范围。 函数(可选) callback 参数如下所示: 承诺<void> 只有 Manifest
chrome.gcm
使用 chrome.gcm 可让应用和扩展程序通过 Firebase Cloud Messaging (FCM) 发送和接收消息。 消息中所有键值对的大小上限(以字节为单位)。 4096 向 FCM 注册该应用。 callback 将返回注册 ID。如果使用同一 senderIds 列表再次调用 register ,则会返回相同的注册 ID。 字符串[] 允许向应用发送消息的服务器 ID 列表。其中应包含至少 1 个发送者 ID,但不得超过 100 个。 函数(可选) callback
chrome.loginState
使用 chrome.loginState API 读取和监控登录状态。 "SIGNIN_PROFILE" 指定扩展程序在登录个人资料中。 "USER_PROFILE" 指定扩展程序在用户个人资料中。 "UNKNOWN" 指定会话状态未知。 "IN_OOBE_SCREEN" 指定用户处于开箱体验屏幕。 "IN_LOGIN_SCREEN" 指定用户正处于登录屏幕。 "IN_SESSION" 指定用户正在会话中。 "IN_LOCK_SCREEN" 指定用户位于锁定屏幕中。
chrome.fontSettings
使用 chrome.fontSettings API 管理 Chrome 的字体设置。 要使用 Font Settings API,您必须声明“fontSettings”权限 清单 。例如: Chrome 允许某些字体设置取决于特定的常规字体系列和语言 脚本。例如, sans-serif 简体中文使用的字体可能与该字体不同 用于 serif 日语。 Chrome 支持的通用字体系列基于 CSS 通用字体系列 , 。如果网页指定了通用字体系列,Chrome
chrome.printingMetrics
使用 chrome.printingMetrics API 提取有关打印使用情况的数据。 "BLACK_AND_WHITE" 指定使用黑白模式。 "COLOR" 指定使用了颜色模式。 "ONE_SIDED" 指定使用单面打印。 &quot;TWO_SIDED_LONG_EDGE&quot; 指定使用双面打印,将长边翻转。 &quot;TWO_SIDED_SHORT_EDGE&quot; 指定使用双面打印,短边翻转。 number 打印介质的高度(以微米为单位)。
chrome.processes
使用 chrome.processes API 与浏览器的进程进行交互。 number 使用的缓存部分(以字节为单位)。 number 缓存的大小(以字节为单位)。 编号( 选填 ) 最近测量的进程 CPU 使用率,表示为进程的所有线程使用的单个 CPU 核心所占的百分比。这会得到一个介于 0 到 CpuInfo.numOfProcessors*100 之间的值,在多线程进程中,该值可以超过 100%。仅当作为 onUpdated 或 onUpdatedWithMemory
chrome.platformKeys
使用 chrome.platformKeys API 访问由平台管理的客户端证书。如果用户或政策授予了此权限,扩展程序便可在其自定义身份验证协议中使用此类证书。例如:这允许在第三方 VPN 中使用平台管理的证书(请参阅 chrome.vpnProvider )。 ArrayBuffer[] 服务器允许的证书授权机构的标识名列表。每个条目都必须是 DER 编码的 X.509 DistinguishedName。 ClientCertificateType []
chrome.devtools.inspectedWindow
使用 chrome.devtools.inspectedWindow API 与检查的窗口进行交互:获取被检查页面的标签页 ID、在被检查的窗口中评估代码、重新加载页面或者获取页面中的资源列表。 必须在 清单 中声明以下键才能使用此 API。 使用 chrome.devtools.inspectedWindow 与检查的窗口进行交互:获取用于 在检查窗口中评估代码、重新加载页面或获取 该页面内的资源列表。 有关使用开发者工具 API 的一般说明,请参阅 DevTools API 摘要 。
chrome.history
使用 chrome.history API 与浏览器的已访问网页的记录进行交互。您可以在浏览器的历史记录中添加、移除和查询网址。如需使用您自己的版本替换历史记录页面,请参阅 覆盖网页 。 您必须声明“历史记录”权限,以便使用 History API。 例如: History API 使用 过渡类型 来描述浏览器如何导航到特定网址 。例如,如果用户通过点击其他网页上的链接访问了某个网页, 为“link” 下表介绍了每种过渡类型。 若要试用此 API,请安装
chrome.identity
使用 chrome.identity API 获取 OAuth2 访问令牌。 字符串 账号的唯一标识符。在账号的整个有效期内,此 ID 不会发生变化。 "SYNC" 指定为主账号启用同步功能。 "ANY" 指定是否存在主账号(如果有)。 string[] 选填 向扩展程序授予的 OAuth2 范围列表。 字符串(可选) 与请求关联的特定令牌。 字符串 应从缓存中移除的特定令牌。 AccountStatus 可选 登录到个人资料的主账号的状态,该个人资料的 ProfileUserInfo
chrome.tts
使用 chrome.tts API 播放合成的文字转语音 (TTS)。另请参阅相关的 ttsEngine API,该 API 允许扩展程序实现语音引擎。 Chrome 为 Windows(使用 SAPI 5)、Mac OS X 和 ChromeOS 上的语音提供原生支持,使用 语音合成功能。在所有平台上,用户都可以 安装会自行注册为备用语音引擎的扩展程序。 通过分机拨打 speak() 开始说话。例如: 要立即停止说话,只需调用 stop() 即可:
chrome.devtools.recorder
使用 chrome.devtools.recorder API 自定义开发者工具中的“Recorder”面板。 有关使用开发者工具 API 的一般说明,请参阅 DevTools API 摘要 。 devtools.recorder API 是一项预览版功能,可让您扩展 Chrome 开发者工具中的 Recorder 面板 。 从 Chrome M105 开始,您可以扩展导出功能。从 Chrome M112 开始,您可以延长重放按钮。 如需注册扩展插件,请使用
chrome.enterprise.hardwarePlatform
使用 chrome.enterprise.hardwarePlatform API 获取运行浏览器的硬件平台的制造商和型号。注意:此 API 仅适用于由企业政策安装的扩展程序。 字符串 字符串 获取硬件平台的制造商和型号,如果扩展程序获得授权,则会通过 callback 返回。 函数(可选) callback 参数如下所示: HardwarePlatformInfo Promise&lt; HardwarePlatformInfo &gt; 只有 Manifest V3
chrome.dom
使用 chrome.dom API 访问适用于扩展程序的特殊 DOM API 获取由指定元素托管的打开的影子根或封闭的影子根。如果该元素未附加影子根,它将返回 null。 HTMLElement 对象 请参阅 https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot
chrome.tabCapture
使用 chrome.tabCapture API 与标签页媒体流进行交互。 借助 chrome.tabCapture API,您可以访问包含视频和媒体内容的 MediaStream 。 当前标签页的音频。只有在用户调用扩展程序后才能调用该方法,例如通过 该扩展程序的 操作按钮 即可。这类似于 activeTab 权限。 为某个标签页获取 MediaStream 后,该标签页中的音频将不再播放 。这与 getDisplayMedia() 函数在以下情况的行为类似:
chrome.management
chrome.management API 提供了多种方法来管理已安装的应用和扩展程序。 您必须声明“management” 扩展程序清单 中的权限,以使用管理功能 API。例如: management.getPermissionWarningsByManifest 、 management.uninstallSelf 和 management.getSelf 无需管理权限。 该项被停用的原因。 “未知” &quot;permissions_increase&quot;
chrome.webNavigation
使用 chrome.webNavigation API 接收有关飞行中导航请求状态的通知。 所有 chrome.webNavigation 方法和事件都需要您声明“webNavigation”权限 在 扩展程序清单 中。例如: 对于成功完成的导航,系统会按以下顺序触发事件: 此过程过程中发生的任何错误都会导致 onErrorOccurred 事件。对于特定的 导航时,在 onErrorOccurred 后不再触发其他事件。 如果导航帧包含子帧,其 onCommitted
chrome.topSites
使用 chrome.topSites API 访问新标签页上显示的热门网站(即最常访问的网站)。这些不包括用户自定义的快捷方式。 您必须声明“topSites” 扩展程序清单 中授予使用此 API 的权限。 若要试用此 API,请安装 chrome-extension-samples 中的 topSites API 示例 存储库 用于封装最常访问的网址(例如新标签页上的默认快捷方式)的对象。 字符串 网页的标题 字符串 最常访问的网址。 获取热门网站列表。 函数(可选) callback
chrome.windows
使用 chrome.windows API 与浏览器窗口进行交互。您可以使用此 API 在浏览器中创建、修改和重新排列窗口。 收到请求时, windows.Window 会包含一组 tabs.Tab 对象。您必须 如果您需要访问 url ,请在 清单 中声明 "tabs" 权限, tabs.Tab 的 pendingUrl 、 title 或 favIconUrl 属性。例如: 扩展系统中的许多函数都接受可选的 windowId 参数,该参数默认为 。
chrome.search
使用 chrome.search API 通过默认提供程序进行搜索。 "CURRENT_TAB" 指定搜索结果显示在发起调用的标签页中或当前所用浏览器的标签页中。 "NEW_TAB" 指定搜索结果显示在新标签页中。 "NEW_WINDOW" 指定搜索结果在新窗口中打开。 Disposition (可选) 应显示搜索结果的位置。默认为 CURRENT_TAB 。 编号( 选填 ) 应显示搜索结果的位置。 tabId 不能与 disposition 一起使用。 字符串
chrome.idle
使用 chrome.idle API 检测机器的空闲状态何时发生变化。 你必须声明“idle”权限,以使用闲置 API。例如: "有效" "idle" "已锁定" 获取屏幕在闲置时自动锁定所用的时间(以秒为单位)。如果屏幕从不自动锁定,则返回时长为零。目前仅适用于 ChromeOS。 函数(可选) callback 参数如下所示: number 屏幕在闲置时自动锁定所用的时间(以秒为单位)。如果屏幕永不自动锁定,则此值为零。 Promise&lt;number&gt; 只有
chrome.types
chrome.types API 包含 Chrome 的类型声明。 ChromeSetting 原型提供了一组常用的函数( get() 、 set() 和 clear() ) 以及 Chrome 浏览器设置的事件发布者 ( onChange )。 代理设置 示例 演示了这些函数的预期用途。 Chrome 可区分浏览器设置的三种不同范围: Chrome 管理不同图层上的设置。以下列表介绍了可 影响有效设置(按优先顺序由高到低)。
chrome.wallpaper
使用 chrome.wallpaper API 更改 ChromeOS 壁纸。 您必须声明“壁纸”权限,以便使用 壁纸 API。例如: 例如,要将壁纸设为 https://example.com/a_file.png ,你可以拨打 chrome.wallpaper.setWallpaper 。 支持的壁纸版式。 “STRETCH” "CENTER" "CENTER_CROPPED" 将壁纸设置为位于 url 或 wallpaperData 且具有指定的 layout 的图片 对象
chrome.enterprise.deviceAttributes
使用 chrome.enterprise.deviceAttributes API 读取设备属性。注意:此 API 仅适用于由企业政策强制安装的扩展程序。 获取管理员注释的营业地点。如果当前用户未关联或管理员未设置任何注释位置,则返回空字符串。 函数(可选) callback 参数如下所示: 字符串 承诺<字符串> 只有 Manifest V3 及更高版本支持 Promise,其他平台需要使用回调。 获取管理员注释的资产 ID。如果当前用户未关联或管理员尚未设置资产
chrome.privacy
您可以使用 chrome.privacy API 控制 Chrome 中可能会影响用户隐私的功能的使用情况。此 API 依赖 ChromeSetting 类型 API 的原型 来获取和设置 Chrome 的配置。 您必须声明“隐私”权限,才能使用该 API。 例如: 读取 Chrome 设置的当前值非常简单。您首先需要找到 属性,那么您将需要对该对象调用 get() ,以检索其 当前值以及您的扩展程序的控制级别。例如,确定 Chrome 的自动填充功能是否 您需要编写:
chrome.systemLog
使用 chrome.systemLog API 记录扩展程序中的 Chrome 系统日志。 字符串 添加新的日志记录。 MessageOptions 日志记录选项。 函数(可选) callback 参数如下所示: 承诺<void> 只有 Manifest V3 及更高版本支持 Promise,其他平台需要使用回调。
chrome.pageCapture
使用 chrome.pageCapture API 可将标签页保存为 MHTML。 MHTML 是大多数浏览器支持的 标准格式 。它将页面封装在单个文件中 及其所有资源(CSS 文件、图片...) 请注意,出于安全考虑,MHTML 文件只能从文件系统加载,而且 只能在主框架中加载 您必须声明“pageCapture”权限,以使用 pageCapture API。例如: 将具有指定 ID 的标签页的内容保存为 MHTML。 对象 number 要另存为 MHTML 的标签页的 ID。 函数(可选)
chrome.fileSystemProvider
您可以使用 chrome.fileSystemProvider API 创建可通过 Chrome 操作系统的文件管理器访问的文件系统。 您必须声明“fileSystemProvider”权限和 扩展程序清单 中的部分,以便使用 File System Provider API。例如: file_system_provider 部分必须声明如下: “文件”应用使用上述信息来适当呈现相关的界面元素。例如,如果 configurable 设置为 true,则系统会呈现用于配置卷的菜单项。同样,如果
chrome.notifications
借助 chrome.notifications API,您可以使用模板创建内容丰富的通知,并在系统任务栏中向用户显示这些通知。 字符串(可选) 按钮图标对 Mac OS X 用户不可见。 字符串 字符串 关于此内容的其他详细信息。 字符串 列表通知中一项的标题。 字符串(可选) Mac OS X 用户看不到应用图标遮罩。 指向应用图标遮罩的网址。网址与 iconUrl 具有相同的限制。 应用图标遮罩应采用 alpha 通道,因为系统只会考虑图片的 alpha 通道。
chrome.power
使用 chrome.power API 替换系统的电源管理功能。 默认情况下,当用户不活动时,操作系统会调暗屏幕,并最终暂停 系统。借助 Power API,应用或扩展程序可使系统保持唤醒状态。 使用此 API,您可以指定要停用电源管理的 Level 。 "system" 使系统保持活动状态,但允许调暗或关闭屏幕。例如, 通信应用在屏幕关闭时继续接收消息。 "display" 级别 使屏幕和系统保持活动状态例如,电子书和演示文稿应用 和系统处于活动状态。
chrome.downloads
此权限 会触发警告 使用 chrome.downloads API 以编程方式启动、监控、操作和搜索下载内容。 您必须在 扩展程序清单 中声明 "downloads" 权限,才能使用此 API。 您可以在 examples/api/downloads 中找到使用 chrome.downloads API 的简单示例 目录。如需获取其他示例以及查看源代码方面的帮助,请参阅 示例 。 布尔值(可选) 布尔值(可选) 文件 下载内容的文件名可疑。 网址 已知下载内容的网址是恶意网址。 内容
chrome.devtools.network
使用 chrome.devtools.network API 检索由开发者工具在“Network”面板中显示的网络请求的相关信息。 必须在 清单 中声明以下键才能使用此 API。 有关使用开发者工具 API 的一般说明,请参阅 DevTools API 摘要 。 网络请求信息以 HTTP 归档格式 ( HAR ) 表示。以下各项的说明: HAR 不在本文档的介绍范围内,请参阅 HAR v1.2 规范 。 对于 HAR, chrome.devtools.network.getHAR()
chrome.vpnProvider
使用 chrome.vpnProvider API 实现 VPN 客户端。 vpnProvider 的典型用法如下: 使用 createConfig 方法创建 VPN 配置。VPN 配置是在原生 ChromeOS 界面中向用户显示的永久条目。用户可以从列表中选择 VPN 配置,然后连接到该配置或断开该配置。 为 onPlatformMessage 、 onPacketReceived 和 onConfigRemoved 事件添加监听器。 当用户连接到 VPN 配置时,会收到
chrome.proxy
使用 chrome.proxy API 管理 Chrome 的代理设置。此 API 依赖 ChromeSetting 类型 API 原型 来获取和设置代理配置。 您必须声明“代理”权限,以使用代理设置 API。例如: 代理设置在 proxy.ProxyConfig 对象中定义。根据 Chrome 的代理设置, 这些设置可能包含 proxy.ProxyRules 或 proxy.PacScript 。 ProxyConfig 对象的 mode 属性决定了 Chrome
chrome.printerProvider
chrome.printerProvider API 公开了打印管理器用于查询由扩展程序控制的打印机、查询其功能以及向这些打印机提交打印作业的事件。 字符串(可选) 打印机的直观易懂的说明。 字符串 唯一打印机 ID。 字符串 打印机的人类可读名称。 为响应 onPrintRequested 事件而返回的错误代码。 "OK" 表示操作已成功完成。 "FAILED" 表示发生了常规故障。 "INVALID_TICKET"
chrome.events
chrome.events 命名空间包含一些常用类型,API 会使用这些类型来调度事件,以便在发生值得注意的事情时通知您。 Event 是一个对象,可让您在发生有趣的事情时收到通知。这里有 使用 chrome.alarms.onAlarm 事件在闹钟经过时接收通知的示例: 如示例所示,您将使用 addListener() 注册接收通知。用于 addListener() 始终是您定义的用于处理事件的函数, 函数取决于您正在处理的事件。查看 alarms.onAlarm
chrome.events
chrome.events 命名空间包含一些常用类型,API 会使用这些类型来调度事件,以便在发生值得注意的事情时通知您。 Event 是一个对象,可让您在发生有趣的事情时收到通知。这里有 使用 chrome.alarms.onAlarm 事件在闹钟经过时接收通知的示例: 如示例所示,您将使用 addListener() 注册接收通知。用于 addListener() 始终是您定义的用于处理事件的函数, 函数取决于您正在处理的事件。查看 alarms.onAlarm
chrome.dom
使用 chrome.dom API 访问适用于扩展程序的特殊 DOM API 获取由指定元素托管的打开的影子根或封闭的影子根。如果该元素未附加影子根,它将返回 null。 HTMLElement 对象 请参阅 https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot
chrome.omnibox
多功能框 API 可让您向 Chrome 浏览器的地址栏(也称为多功能框)注册关键字。 当该用户输入您扩展程序中的关键字后,便开始只与您的 。每次按键操作都会发送到您的扩展程序,并且您可以在响应中提供建议。 建议可以采用多种格式以各种格式进行显示。当用户接受建议后 您的扩展程序会收到通知,并可以采取相应措施。 必须在 清单 中声明以下键才能使用此 API。 您必须在 清单 中添加 "omnibox.keyword" 字段,才能使用多功能框 API。您 还应该指定一个 16 x 16
chrome.browsingData
使用 chrome.browsingData API 从用户的本地个人资料中移除浏览数据。 您必须在 扩展程序清单 中声明 "browsingData" 权限,才能使用此 API。 此 API 最简单的用例是一种基于时间的机制,用于清除用户浏览数据。 您的代码应提供一个时间戳,指明历史日期,在此日期之后 浏览数据。此时间戳的格式设置为自事件发生以来经过的毫秒数 Unix 纪元(可以使用 getTime() 方法从 JavaScript Date 对象中检索)。
chrome.system.memory
chrome.system.memory API。 number 可用容量的量(以字节为单位)。 number 物理内存容量的总容量(以字节为单位)。 获取物理内存信息。 函数(可选) callback 参数如下所示: MemoryInfo Promise&lt; MemoryInfo &gt; 只有 Manifest V3 及更高版本支持 Promise,其他平台需要使用回调。
chrome.dns
使用 chrome.dns API 进行 DNS 解析。 如需使用此 API,您必须在 清单 中声明 "dns" 权限。 以下代码会调用 resolve() 来检索 example.com 的 IP 地址。 service-worker.js : 字符串(可选) 表示 IP 地址字面量的字符串。仅当 resultCode 指示成功时才提供。 number 结果代码。零表示成功。 解析给定的主机名或 IP 地址字面量。 字符串 要解析的主机名。 函数(可选) callback 参数如下所示:
API 参考
针对 Chrome 扩展程序可用的所有 API 的完整参考。这包括适用于已弃用的 Chrome 应用平台的 API,以及仍在测试和开发阶段的 API。
chrome.alarms
使用 chrome.alarms API 安排代码定期运行或在未来的指定时间运行。 如需使用 chrome.alarms API,请在 清单 中声明 "alarms" 权限: 以下示例展示了如何使用和响应闹钟。如需试用此 API, 安装 chrome-extension-samples 中的 chrome-extension-samples 存储库 以下示例会在安装扩展程序时在 Service Worker 中设置警报: service-worker.js : 以下示例根据已响铃闹钟的名称设置
chrome.contextMenus
使用 chrome.contextMenus API 向 Google Chrome 的上下文菜单中添加项。您可以选择从右键菜单中添加的对象类型,例如图片、超链接和页面。 上下文菜单项可以出现在任何文档(或文档中的框架)中,甚至是那些带有 file:// 的菜单项 或 chrome:// 网址。要控制您的内容可以显示在哪些文档中,请指定 documentUrlPatterns 字段。 create() update() 您可以根据需要创建任意数量的上下文菜单项,但如果扩展程序中的多个菜单项 则
chrome.audio
通过提供 chrome.audio API,用户可以获取有关系统连接到的音频设备的信息并控制该设备。此 API 目前只能在适用于 ChromeOS 的自助服务终端模式下使用。 字符串 设备名称。 DeviceType 设备类型。 字符串 简单易懂的名称(例如“USB 麦克风”)。 字符串 音频设备的唯一标识符。 布尔值 如果这是当前活跃设备,则为 true。 number 设备的音量、输出的音量、输入的增益。 字符串(可选) 稳定/持久保留的设备 ID 字符串(如果有)。 StreamType
chrome.commands
您可以使用 Command API 添加可在扩展程序中触发操作的键盘快捷键,例如,用于打开浏览器操作或向扩展程序发送命令的操作。 必须在 清单 中声明以下键才能使用此 API。 Commands API 允许扩展程序开发者定义特定命令,并将它们绑定到默认命令 组合键。扩展程序接受的每个命令都必须声明为 "commands" 对象。 属性键用作命令的名称。命令对象可以采用两个属性。 可选属性,用于声明命令的默认键盘快捷键。如果省略, 命令就会解除绑定此属性可以采用字符串或对象值。 字符串值
chrome.debugger
chrome.debugger API 可用作 Chrome 远程调试协议 的替代传输服务。使用 chrome.debugger 附加到一个或多个标签页,以便对网络交互进行插桩、调试 JavaScript、转变 DOM 和 CSS 等。使用 Debuggee 属性 tabId 可定位具有 sendCommand 的标签页,并通过 tabId 从 onEvent 回调对事件进行路由。 出于安全考虑, chrome.debugger API 不提供对所有 Chrome
chrome.declarativeContent
使用 chrome.declarativeContent API 可根据网页内容执行操作,而无需读取网页内容的权限。 声明式 Content API 可让您根据 或者 CSS 选择器与页面上的某个元素匹配,无需 添加 主机权限 或注入 内容脚本 。 使用 activeTab 权限,以在用户点击 操作。 规则由条件和操作组成。如果满足任一条件,则所有操作 。这些操作包括 setIcon 和 showAction 。 当且仅当所有网页都列出时, PageStateMatcher
chrome.declarativeNetRequest
chrome.declarativeNetRequest API 用于通过指定声明式规则来屏蔽或修改网络请求。这样一来,扩展程序就能够修改网络请求,而不会拦截这类请求并查看其中的内容,从而更好地保护用户隐私。 declarativeNetRequestFeedback host_permissions 除了上述权限之外,某些类型的规则集(具体来说是静态规则集)还要求声明 "declarative_net_request" 清单键,该清单键应该是具有一个名为 "rule_resources"
chrome.browsingData
使用 chrome.browsingData API 从用户的本地个人资料中移除浏览数据。 您必须声明“browsingData”权限,才能使用此 API。 此 API 最简单的用例是一种基于时间的机制,用于清除用户浏览数据。 您的代码应提供一个时间戳,指明历史日期,在此日期之后 浏览数据。此时间戳的格式设置为自事件发生以来经过的毫秒数 Unix 纪元(可通过 getTime 方法从 JavaScript Date 对象中检索)。 例如,要清除用户上周的所有浏览数据,您可以编写如下代码: 如下:
示例
GitHub 上 提供了 Chrome 扩展程序的示例。
发布您的应用
待办
Chrome 扩展程序发生了什么情况?
简要介绍 Chrome 扩展程序近期的变化,以及即将推出的令人期待的扩展程序功能。
Chrome 扩展程序:重要的政策更新
本公告包含对“开发者计划政策”页面的一系列更新,这些更新旨在鼓励开发高质量的产品、防止欺骗性行为并确保用户知情同意。
向 YouTube 添加可信类型
YouTube 正在通过可信类型增强平台安全性,以防止跨站脚本攻击,但这可能会影响您的扩展程序。
Chrome 应用商店幕后:询问信任与安全您的问题
我们与负责 Chrome 应用商店审核的团队坐下来畅聊。
清单 - Chrome 最低版本
manifest.json 的 minimum_chrome_version 属性的参考文档。
清单 - 试用令牌
关于 manifest.json 的 trial_tokens 属性的参考文档。
Chrome 扩展程序发生了什么情况?
简要介绍 Chrome 扩展程序近期的变化,以及即将推出的令人期待的扩展程序功能。
Chrome 应用商店开发者信息中心内的版本回滚
本周,我们很高兴地推出一项新功能,让开发者能够将其扩展程序在 Chrome 应用商店中的版本回滚到之前发布的版本。我们的目标是让开发者在发布更新时更加放心,尤其是在过渡到清单 V3 时。 从今天起,您无需提交包含 bug 修复程序的新版扩展程序,并等待其通过审核。不过,您可以通过 更多 菜单或商品的文件包页面启动回滚。 回滚需要提供一个新版本号(扩展程序的旧版本将以此版本号重新发布),以及回滚原因。填写所需信息后,确认回滚。 回滚完成后,系统会通过正常的 Chrome
使您的扩展程序可供访问
对于许多用户而言,无障碍功能实际上就是界面,其功能对许多其他用户来说非常有用。
国际化接口
使用 chrome.i18n API 以多种语言呈现您的界面。
Chrome 扩展程序:测试 Service Worker 中止过程
在这篇博文中,eyeo 团队分享了他们对测试扩展 Service Worker 这一问题的经历。特别是如何确保其 Chrome 扩展程序在 Service Worker 被暂停时正常工作。
配置扩展程序图标
扩展程序至少需要一个图标才能显示在工具栏中。
迁移到 Manifest V3
将 Manifest V2 扩展程序转换为 Manifest V3 扩展程序的指南。
使用 WebUSB
WebUSB API 可在扩展程序中提供 WebUSB API,该 API 可将非标准通用串行总线 (USB) 兼容设备连接到网络。
使用 WebHID
WebHID API 可在扩展程序中提供与人机接口设备 (HID) 兼容的设备在网络上。
清单 - 内容安全政策
介绍 manifest.json 的内容安全政策属性的参考文档。
chrome.runtime
使用 chrome.runtime API 检索服务工件、返回清单的详细信息,以及监听和响应扩展程序生命周期中的事件。您还可以使用此 API 将网址的相对路径转换为完全限定网址。 此 API 的大多数成员 不需要 任何权限。 connectNative() 、 sendNativeMessage() 和 onNativeConnect 需要此权限。 以下示例展示了如何在清单中声明 "nativeMessaging" 权限: manifest.json: Runtime API
声明权限
manifest.json 中权限属性的有效值概览。
权限警告准则
Chrome 扩展程序中权限警告的运作方式。
使用 Web 推送
关于如何将 Web 推送与 Chrome 扩展程序搭配使用的分步指南
响应命令
响应扩展程序中的自定义组合键。
Chrome 扩展程序发生了什么情况?
简要介绍 Chrome 扩展程序近期的变化,以及即将推出的令人期待的扩展程序功能。
通过多功能框触发操作
通过多功能框触发操作。
将 Firebase Cloud Messaging (FCM) 与 chrome.gcm 搭配使用
有关如何将 Firebase Messaging 与 chrome.gcm 搭配使用的分步指南
实现操作
响应用户点击工具栏的操作。
构建上下文菜单
实现弹出式窗口,该窗口是可让用户调用扩展程序功能的窗口。
处理远程托管代码违规行为
Service Worker 让扩展程序仅在需要时运行,从而节省资源。
添加弹出式窗口
实现弹出式窗口,该窗口是可让用户调用扩展程序功能的窗口。
恢复向 Manifest V3 的转换
去年 12 月,我们暂停了计划中的弃用 Manifest V2 的计划,以便解决开发者反馈的问题,并为 迁移问题 提供更好的解决方案。根据这些反馈,我们对 Manifest V3 做出了一些更改,以 填补这些空白 ,包括: 除了填补空白之外,我们还为该平台添加了新功能,例如今年早些时候发布的 Side Panel API 和目前处于 Beta 版阶段的 Reading List API 。我们最近在广告过滤开发者峰会上讨论了其中的许多变化,并 分享 了我们根据反馈做出的更改和改进的更多背景信息。
改进 Manifest V3 中的内容过滤
在过去一年里,我们一直在积极与多款内容屏蔽扩展程序背后的供应商讨论如何改进 MV3 扩展程序平台。在这些讨论(其中许多是在 WebExtensions 社区组 [ WECG ] 中与其他浏览器合作进行的)的基础上,我们能够做出重大改进。 一组过滤规则通常会分组到列表中。例如,更通用的列表可能包含适用于所有用户的规则,而更具体的列表可能会隐藏仅部分用户希望屏蔽的位置特定内容。直到最近,我们允许每个扩展程序为用户提供 50 个列表(或“静态规则集”)供其选择,并且同时启用其中的 10
Chrome 120 扩展程序中的新功能
面向 Chrome 扩展程序开发者的 Chrome 120 重要变更摘要。
file_handlers
manifest.json 的 file_handlers 属性的参考文档。
ChromeOS 上的文件处理
如何在 Chrome 扩展程序 Service Worker、弹出式窗口、侧边栏或内容脚本中打开文件。
Chrome 扩展程序发生了什么情况?
简要介绍 Chrome 扩展程序近期的变化,以及即将推出的令人期待的扩展程序功能。
针对 Chrome 扩展程序的端到端测试
如何为扩展程序编写端到端测试。
对 Chrome 扩展程序进行单元测试
如何为扩展程序编写单元测试。
使用 Puppeteer 测试 Chrome 扩展程序
如何使用 Puppeteer 为 Chrome 扩展程序编写自动化测试。
查找和跟踪错误
检查是否已有人报告过 bug 或功能请求。
提交扩展程序错误
如何报告扩展程序错误或文档问题。
开发者工具提示:调试 Chrome 扩展程序
了解如何使用开发者工具调试 Chrome 扩展程序。
Google 编程之夏和 Chrome 扩展程序
获得参与 Google 编程之夏的相关经验和建议。
发布扩展程序
有关发布新的 Manifest V3 扩展程序的指南
将安全检查添加到 chrome://extensions 页面
从 Chrome 117 开始,当用户安装的扩展程序不在 Chrome 应用商店中时,Chrome 会主动向用户突出显示。
清单 - 内容脚本
有关 manifest.json 的 "content_scripts" 属性的参考文档。
Chrome 116 for Extensions 中的新变化
面向 Chrome 扩展程序开发者的 Chrome 116 重要变更摘要。
Chrome 扩展程序发生了什么情况?
简要介绍今年到目前为止 Chrome 扩展程序中发生的变化,以及即将推出的令人期待的扩展程序功能。
在 Service Worker 中使用 WebSocket
有关如何在 Chrome 扩展程序中连接到 WebSocket 的分步说明。
使用地理定位
如何在 Chrome 扩展程序 Service Worker、弹出式窗口、侧边栏或内容脚本中使用地理定位。
清单 - 背景
manifest.json 的 background 属性的参考文档。
扩展程序 Service Worker 简介
扩展程序 Service Worker 是扩展程序的中心事件处理脚本。这使它们与 Web Service Worker 不同。
扩展 Service Worker 生命周期
扩展 Service Worker 既能响应标准 Service Worker 事件,也能响应扩展命名空间中的事件。之所以将它们一起显示,是因为在使用扩展程序时,一种类型经常会跟随另一种类型。
Extension Service Worker 基础知识
Extension Service Worker 的安装和更新方式与 Web Service Worker 不同。
Service Worker 中的事件
扩展程序 Service Worker 既可以响应标准 Service Worker 事件,也可以响应扩展程序 API 中的许多事件。
录音和屏幕截图
如何录制标签页、窗口或屏幕中的音频或视频。
使用 Service Worker 处理事件
了解如何创建和调试扩展程序服务工作器。
更新清单
Manifest V3 与 Manifest V2 需要的 manifest.json 文件格式略有不同。
更新代码
三个部分的第一部分介绍了需要对不属于扩展 Service Worker 的代码所做的更改。
迁移到 Service Worker
Service Worker 让扩展程序仅在需要时运行,从而节省资源。
替换屏蔽型 Web 请求监听器
三个部分的第 2 部分介绍了需要对不属于扩展程序 Service Worker 的代码进行更改。
提高扩展程序的安全性
最后三部分介绍需要对不属于扩展程序 Service Worker 的代码进行更改。
原生消息传递
与 Chrome 扩展程序中的原生应用互发消息。
获取有关 Chrome 扩展程序的帮助
在哪里可以针对文档中未涵盖的问题寻求帮助。
更长的扩展 Service Worker 生命周期
现在,只要正在接收事件,Extension Service Worker 就可以保持活动状态。这可以提高扩展 Service Worker 的可靠性,但有一个您应该避免的陷阱。
Manifest V3 中的屏幕外文档
推出 Offscreen Documents API for Chrome 扩展程序开发。
正在获取网站图标
如何获取网站图标。
Chrome 应用商店政策更新
Chrome 即将更新 Chrome 应用商店的开发者计划政策,以便明确说明我们的指导原则、提供有关违规处置的更多背景信息,并让我们的政策更易于理解。
清单 - oauth2
关于 manifest.json 的 oauth2 属性的参考文档。
Chrome 应用商店政策更新
Chrome 即将更新 Chrome 应用商店的开发者计划政策,以便明确说明我们的指导原则、提供有关违规处置的更多背景信息,并让我们的政策更易于理解。
清单 - input_components
manifest.json 的 input_components 属性的参考文档。
开启 Chrome 扩展程序开发之旅的新方式
开启 Chrome 开发者学习之旅的更好方式。
管理标签页
了解如何使用标签页分组以编程方式整理标签页。
在每个网页上运行脚本
了解如何自动向现有网页添加新元素。
Hello World 扩展
创建您的第一个 Hello World Chrome 扩展程序。
将脚本注入到当前活动的标签页中
了解如何简化当前页面的样式。
清单 - 作者
manifest.json 的作者姓名属性的参考文档。
有关向 Manifest V3 过渡的更多详细信息
关于将扩展程序迁移至 Manifest V3 的计划的新详细信息
改版 Chrome 应用商店开发者信息中心内的 Google Analytics(分析)
Google 即将为 Chrome 应用商店开发者信息中心推出经过改进的商品分析体验。新的信息中心一目了然,并且会预先整合最有用的信息。
2021 年第 3 季度 Chrome 应用商店政策更新
我们更新了安全要求并进一步阐明了一些政策,以保持优质的扩展程序质量,并为开发者提供一致的体验。
Chrome 扩展程序改用 Manifest V3
分享将扩展程序迁移至 Manifest V3 的计划的详细信息
跨源嵌入器政策
有关 manifest.json 的 cross_origin_embedder_policy 属性的参考文档。
跨源嵌入器政策
有关 manifest.json 的 cross_origin_embedder_policy 属性的参考文档。
跨域隔离
扩展程序跨域隔离概览
跨源 opener 政策
manifest.json 的 cross_origin_opener_policy 属性的参考文档。
跨源 opener 政策
manifest.json 的 cross_origin_opener_policy 属性的参考文档。
Chrome 扩展程序:阐明我们的扩展程序政策,打造更安全、更一致的应用商店
我们更新了安全要求并进一步阐明了一些政策,以保持优质的扩展程序质量,并为开发者提供一致的体验。
Manifest V2 简介
面向 Chrome 扩展程序开发者的文档。
主机权限的用户控制:转换指南
从 Chrome 70 开始,有关更新扩展程序以处理运行时主机权限变更的指南。
内嵌式安装弃用迁移常见问题解答
关于弃用以内嵌方式安装 Chrome 扩展程序的常见问题解答。
迁移到事件驱动型后台脚本
如何将永久性后台脚本迁移到基于事件的、非永久性模型,以提高 Chrome 扩展程序的性能。
达到最佳效果
关于如何构建高性能 Chrome 扩展程序的指南。
保护用户隐私
确保您的 Chrome 扩展程序能保护用户隐私的准则。
保护用户隐私
确保您的 Chrome 扩展程序能保护用户隐私的准则。
设计界面
Chrome 扩展程序的界面和设计指南。
确保安全
如何保障 Chrome 扩展程序的安全。
确保安全
如何保障 Chrome 扩展程序的安全。
在 Linux 上安装扩展程序
如何打包、托管和更新个人服务器中的 crx 文件。
Linux 的自托管
如何为 Linux 用户打包、托管和更新个人服务器中的 crx 文件。
event_rules
manifest.json 的 event_rules 属性的参考文档。
event_rules
manifest.json 的 event_rules 属性的参考文档。
共享模块
如何在 Chrome 扩展程序之间共享代码。
共享模块
如何在 Chrome 扩展程序之间共享代码。
内容丰富的通知 API
如何向您的 Chrome 扩展程序用户显示通知。
使用 Notifications API
向 Chrome 扩展程序用户显示通知。
Chrome 33 Hosting 变更
有关从 Chrome 33 版开始的 Chrome 扩展程序的托管变化的详细信息。
常见问题解答
关于 Chrome 扩展程序的常见问题解答。
使用入门
有关如何创建 Chrome 扩展程序的分步说明。
教程:迁移到 Manifest V2
关于如何从 Manifest v1 迁移到 Manifest V2 的准则。
chrome.location
chrome.location API 的参考文档。
覆盖 Chrome 设置
如何通过 Chrome 扩展程序覆盖 Chrome 设置。
覆盖 Chrome 设置
如何通过 Chrome 扩展程序覆盖 Chrome 设置。
代管式存储空间的清单
manifest.json 的 storage 属性的参考文档。
存储区域的清单
manifest.json 的 storage 属性的参考文档。
externally_connectable
manifest.json 的 external_connectable 属性参考文档。
externally_connectable
manifest.json 的 external_connectable 属性参考文档。
清单 - 说明
manifest.json 的说明属性的参考文档。
清单 - 版本
manifest.json 的版本属性的参考文档。
Manifest V2 - 版本 [已弃用]
manifest.json 的版本属性的参考文档。
清单 - 首页网址
manifest.json 的 home_url 属性的参考文档。
清单 - Nacl 模块
manifest.json 的 nacl_modules 属性的参考文档。
清单 - 沙盒
manifest.json 的沙盒属性的参考文档。
清单 - 无痕模式
manifest.json 的无痕模式属性的参考文档。
清单 - 图标
manifest.json 的 Icon 属性的参考文档。
清单 - 默认语言区域
manifest.json 的 default_locale 属性的参考文档。
清单 - 要求
manifest.json 的要求属性的参考文档。
清单 - 默认语言区域
manifest.json 的 default_locale 属性的参考文档。
清单 - 网络可访问的资源
关于 manifest.json 的 web_accessibility_resources 属性的参考文档。
清单 - 已启用离线功能
关于 manifest.json 的 offline_enabled 属性的参考文档。
清单 - 说明
manifest.json 的说明属性的参考文档。
清单 - Chrome 最低版本
manifest.json 的 minimum_chrome_version 属性的参考文档。
清单 - 名称和简称
有关 manifest.json 的 name 和 short_name 属性的参考文档。
清单 - 网络可访问的资源
关于 manifest.json 的 web_accessibility_resources 属性的参考文档。
清单 - 无痕模式
manifest.json 的无痕模式属性的参考文档。
清单 - 图标
manifest.json 的 Icon 属性的参考文档。
清单 - 沙盒
manifest.json 的沙盒属性的参考文档。
清单版本
manifest.json 的 manifest_version 属性的参考文档。
清单 - 键
manifest.json 的关键属性的参考文档。
清单 - 名称
manifest.json 的 name 属性的参考文档。
清单 - short_name
manifest.json 的 short_name 属性的参考文档。
清单 - 首页网址
manifest.json 的 home_url 属性的参考文档。
清单 - 要求
manifest.json 的要求属性的参考文档。
清单 - 键
manifest.json 的关键属性的参考文档。
什么是扩展程序?
Chrome 扩展程序的用途以及扩展程序的开发方式。
声明权限
manifest.json 中权限属性的有效值概览。
“activeTab”权限
如何在 Chrome 扩展程序中使用 activeTab 权限。
activeTab 权限
如何在 Chrome 扩展程序中使用 activeTab 权限。
什么是主题?
有关如何创建主题的指南。
清单文件格式
可在 Chrome 扩展程序中使用的 manifest.json 属性概览。
为用户提供选项
如何让用户自定义您的扩展程序。
架构概览
Chrome 扩展程序软件架构的简要说明。
调试扩展程序
有关调试 Chrome 扩展程序的说明。
OAuth2:使用 Google 对用户进行身份验证
有关如何构建通过 Google People API、Chrome Identity API 和 OAuth2 访问用户的 Google 通讯录的扩展程序的分步说明。
清单版本
manifest.json 的 manifest_version 属性,表示 Chrome 扩展程序所针对的清单规范版本。
跨源网络请求
在您的 Chrome 扩展程序中实现跨源网络请求。
消息传递
如何在扩展程序和内容脚本之间传递消息。
Chrome Web Store
如何在 Chrome 应用商店中托管您的扩展程序,并更新 Chrome 应用商店中托管的扩展程序。
本地化消息格式
关于 Chrome 扩展程序 messages.json 文件格式的参考文档。
什么是主题?
有关如何创建主题的指南。
在 Chrome 扩展程序中使用 eval
如何在 Chrome 扩展程序中使用 eval()。
OAuth 2.0:向 Google 验证用户身份
有关如何构建通过 Google People API、Chrome Identity API 和 OAuth2 访问用户的 Google 通讯录的扩展程序的分步说明。
调试扩展程序
有关如何调试 Chrome 扩展程序的分步说明。
声明权限并警告用户
如何实现权限以保护您的用户和扩展程序。
匹配模式
主机权限和内容脚本模式匹配的工作原理以及示例。
覆盖 Chrome 页面
如何在 Chrome 扩展程序中覆盖 Chrome 书签管理器、历史记录和“新标签页”页面。
清单文件格式
Chrome 扩展程序的 manifest.json 属性概览。
为用户提供选项
如何让用户自定义您的扩展程序。
替换 Chrome 网页
如何在 Chrome 扩展程序中覆盖 Chrome 书签管理器、历史记录和“新标签页”页面。
消息传递
如何在扩展程序和内容脚本之间传递消息。
教程:Google Analytics(分析)
分步说明如何使用 Google Analytics(分析)跟踪您的扩展程序的使用情况。
匹配模式
了解 Chrome 扩展程序中的网址匹配模式。
使用 Google Analytics(分析)4
介绍如何通过 Google Analytics(分析)4 跟踪扩展程序使用情况的分步说明。
在沙盒化 iframe 中使用 eval()
如何在 Chrome 扩展程序中使用 eval()。
扩展开发者工具
如何创建 Chrome 扩展程序,向 Chrome 开发者工具添加功能。
扩展程序开发概览
Chrome 扩展程序功能和组件概览。
内容脚本
内容脚本的说明,以及如何在 Chrome 扩展程序中使用这些脚本。
其他扩展程序分发选项
如何在 Chrome 应用商店之外分发 Chrome 扩展程序。
使用其他安装方法
如何使用偏好设置 JSON 或 Windows 注册表安装 Chrome 扩展程序。
内容脚本
内容脚本的说明,以及如何在 Chrome 扩展程序中使用这些脚本。
使用 webKit 发送内容丰富的通知
如何在 Chrome 扩展程序中实现通知。
无障碍功能 (a11y)
如何使您的 Manifest V2 Chrome 扩展程序可供访问。
扩展开发者工具
如何创建 Chrome 扩展程序,为 Chrome 开发者工具添加功能。
支持无障碍功能
如何使您的 Chrome 扩展程序可以访问。
使用后台脚本管理事件
如何通过 Chrome 扩展程序后台脚本响应浏览器触发器(事件)。
Chrome Web Store API Reference
This reference describes the methods and resource representation available for the Chrome Web Store Publish API. Each resource type has one or more data representations and one or more methods. See Using the Chrome Web Store Publish API for a guide
Use the Chrome Web Store Publish API
How to programmatically create, update, and publish items in the Chrome Web Store.
Google Play for Education Addendum to the Google Chrome Web Store Developer Agreement
In connection with the Google Chrome Web Store, Google may make certain Chrome Web Store applications available in Google's Play for Education site. If You or Your organization is interested in participating, please verify that the
Policies
Extension policies
chrome.pageCapture
Use the chrome.pageCapture API to save a tab as MHTML. MHTML is a standard format supported by most browsers. It encapsulates in a single file a page and all its resources (CSS files, images..). Note that for security reasons a MHTML file can only be
Chrome Web Store
Chrome Web Store An online marketplace where users can browse for extensions and themes. Publish your extension there and make it accessible to the world. dashboard Developer Dashboard Publish your extension and manage your store items. local_mall
chrome.declarativeWebRequest
Note: this API is deprecated. Check out the declarativeNetRequest API instead. Use the chrome.declarativeWebRequest API to intercept, block, or modify requests in-flight. It is significantly faster than the chrome.webRequest API because you can
chrome.offscreen
Use the offscreen API to create and manage offscreen documents. To use the Offscreen API, declare the "offscreen" permission in the extension manifest. For example: Service workers don't have DOM access, and many websites have content security
Prepare your extension as we begin testing a new extensions menu
How to prepare your extension for the new extensions menu.
chrome.systemLog
Use the chrome.systemLog API to record Chrome system logs from extensions. string Adds a new log record. MessageOptions The logging options. function optional The callback parameter looks like: Promise<void> Promises are supported in Manifest
chrome.tts
Use the chrome.tts API to play synthesized text-to-speech (TTS). See also the related ttsEngine API, which allows an extension to implement a speech engine. Chrome provides this capability on Windows (using SAPI 5), Mac OS X, and ChromeOS,
chrome.notifications
Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. string optional Button icons not visible for Mac OS X users. string string Additional details about this item.
chrome.debugger
The chrome.debugger API serves as an alternate transport for Chrome's remote debugging protocol. Use chrome.debugger to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, and more. Use the Debuggee
chrome.webNavigation
Use the chrome.webNavigation API to receive notifications about the status of navigation requests in-flight. All chrome.webNavigation methods and events require you to declare the "webNavigation" permission in the extension manifest. For example: For
chrome.identity
Use the chrome.identity API to get OAuth2 access tokens. string A unique identifier for the account. This ID will not change for the lifetime of the account. "SYNC" Specifies that Sync is enabled for the primary account. "ANY" Specifies the existence
chrome.management
The chrome.management API provides ways to manage installed apps and extensions. You must declare the "management" permission in the extension manifest to use the management API. For example: management.getPermissionWarningsByManifest(),
chrome.downloads
Use the chrome.downloads API to programmatically initiate, monitor, manipulate, and search for downloads. You must declare the "downloads" permission in the extension manifest to use this API. You can find simple examples of using the
chrome.documentScan
Use the chrome.documentScan API to discover and retrieve images from attached document scanners. The Document Scan API is designed to allow apps and extensions to view the content of paper documents on an attached document scanner. string Provides
chrome.loginState
Use the chrome.loginState API to read and monitor the login state. "SIGNIN_PROFILE" Specifies that the extension is in the signin profile. "USER_PROFILE" Specifies that the extension is in the user profile. "UNKNOWN" Specifies that the session state
chrome.input.ime
Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window. You must declare the "input" permission in the extension manifest to use the
chrome.platformKeys
Use the chrome.platformKeys API to access client certificates managed by the platform. If the user or policy grants the permission, an extension can use such a certficate in its custom authentication protocol. E.g. this allows usage of platform
chrome.devtools.performance
Use the chrome.devtools.performance API to listen to recording status updates in the Performance panel in DevTools. See DevTools APIs summary for general introduction to using Developer Tools APIs. The chrome.devtools.performance API allows
chrome.devtools.network
Use the chrome.devtools.network API to retrieve the information about network requests displayed by the Developer Tools in the Network panel. Network requests information is represented in the HTTP Archive format ( HAR ). The description of HAR is
Creating a great listing page
Best practices on how to make a high-quality, engaging listing page for your item in the Chrome Web Store.
Best Practices and Guidelines
Research and understand the Chrome Web Store policies. Before developing a Chrome extension, it is important to review the Chrome Web Store Developer Program Policies and ensure your extension complies with all guidelines and requirements. Extensions
Deceptive Installation Tactics FAQ
Frequently asked questions about Chrome Web Store's policies on deceptive installation tactics.
Deceptive Installation Tactics
Extensions must be marketed responsibly. The set of functionalities promised by the extension must be stated clearly and in a transparent manner. The outcome of any user interaction should match the reasonable expectations that were set with the
Extensions quality guidelines FAQ
Frequently asked questions about the single purpose policy.
Quality guidelines
An extension must have a single purpose that is narrow and easy to understand. Don't create an extension that requires users to accept bundles of unrelated functionality. If two pieces of functionality are clearly separate, they should be put into
Listing Requirements
If your product has a blank description field or is missing an icon or screenshots, it will be rejected. Ensure your product's listing information is up to date, accurate, and comprehensive. We don't allow extensions with misleading, inaccurate,
chrome.enterprise.hardwarePlatform
Use the chrome.enterprise.hardwarePlatform API to get the manufacturer and model of the hardware platform where the browser runs. Note: This API is only available to extensions installed by enterprise policy. string string Obtains the manufacturer
chrome.enterprise.deviceAttributes
Use the chrome.enterprise.deviceAttributes API to read device attributes. Note: This API is only available to extensions force-installed by enterprise policy. Fetches the administrator-annotated Location. If the current user is not affiliated or no
chrome.enterprise.networkingAttributes
Use the chrome.enterprise.networkingAttributes API to read information about your current network. Note: This API is only available to extensions force-installed by enterprise policy. string optional The device's local IPv4 address (undefined if not
Extensions / Develop
Learn how to develop extensions
Content filtering
An explanation of content filtering and how to approach it in your Chrome Extension.
chrome.tabCapture
Use the chrome.tabCapture API to interact with tab media streams. The chrome.tabCapture API lets you access a MediaStream containing video and audio of the current tab. It can only be called after the user invokes an extension, such as by clicking
chrome.proxy
Use the chrome.proxy API to manage Chrome's proxy settings. This API relies on the ChromeSetting prototype of the type API for getting and setting the proxy configuration. You must declare the "proxy" permission in the extension manifest to use the
chrome.fileSystemProvider
Use the chrome.fileSystemProvider API to create file systems, that can be accessible from the file manager on Chrome OS. You must declare the "fileSystemProvider" permission and section in the extension manifest to use the File System Provider API.
chrome.devtools.recorder
Use the chrome.devtools.recorder API to customize the Recorder panel in DevTools. devtools.recorder API is a preview feature that allows you to extend the Recorder panel in Chrome DevTools. See DevTools APIs summary for general introduction to using
chrome.system.memory
The chrome.system.memory API. number The amount of available capacity, in bytes. number The total amount of physical memory capacity, in bytes. Get physical memory information. function optional The callback parameter looks like: MemoryInfo
chrome.wallpaper
Use the chrome.wallpaper API to change the ChromeOS wallpaper. You must declare the "wallpaper" permission in the app's manifest to use the wallpaper API. For example: For example, to set the wallpaper as the image at https://example.com/a_file.png,
chrome.system.cpu
Use the system.cpu API to query CPU metadata. string The architecture name of the processors. string[] A set of feature codes indicating some of the processor's capabilities. The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3",
chrome.idle
Use the chrome.idle API to detect when the machine's idle state changes. You must declare the "idle" permission in your extension's manifest to use the idle API. For example: "active" "idle" "locked" Gets the time, in seconds, it takes until the
chrome.power
Use the chrome.power API to override the system's power management features. Using this API, you can specify the Level to which power management is disabled. The "system" level keeps the system active, but allows the screen to be dimmed or turned
chrome.gcm
Use chrome.gcm to enable apps and extensions to send and receive messages through Firebase Cloud Messaging (FCM). The maximum size (in bytes) of all key/value pairs in a message. 4096 Registers the application with FCM. The registration ID will be
chrome.types
The chrome.types API contains type declarations for Chrome. The ChromeSetting type provides a common set of functions ( get(), set(), and clear() ) as well as an event publisher ( onChange ) for settings of the Chrome browser. The proxy
chrome.accessibilityFeatures
Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get feature states the extension
chrome.devtools.inspectedWindow
Use the chrome.devtools.inspectedWindow API to interact with the inspected window: obtain the tab ID for the inspected page, evaluate the code in the context of the inspected window, reload the page, or obtain the list of resources within the page.
chrome.printerProvider
The chrome.printerProvider API exposes events used by print manager to query printers controlled by extensions, to query their capabilities and to submit print jobs to these printers. string optional Printer's human readable description. string
chrome.vpnProvider
Use the chrome.vpnProvider API to implement a VPN client. Typical usage of chrome.vpnProvider is as follows: Create VPN configurations by calling createConfig(). A VPN configuration is a persistent entry shown to the user in a ChromeOS UI. The user
chrome.webAuthenticationProxy
The chrome.webAuthenticationProxy API lets remote desktop software running on a remote host intercept Web Authentication API (WebAuthn) requests in order to handle them on a local client. string The PublicKeyCredentialCreationOptions passed to
chrome.history
Use the chrome.history API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see Override Pages. To interact with the user's
chrome.tabGroups
Use the chrome.tabGroups API to interact with the browser's tab grouping system. You can use this API to modify and rearrange tab groups in the browser. To group and ungroup tabs, or to query what tabs are in groups, use the chrome.tabs API. The
chrome.system.storage
Use the chrome.system.storage API to query storage device information and be notified when a removable storage device is attached and detached. "success" The ejection command is successful -- the application can prompt the user to remove the device.
chrome.desktopCapture
The Desktop Capture API captures the content of the screen, individual windows, or individual tabs. Enum used to define set of desktop media sources used in chooseDesktopMedia(). "screen" "window" "tab" "audio" Mirrors SelfCapturePreferenceEnum.
chrome.instanceID
Use chrome.instanceID to access the Instance ID service. Resets the app instance identifier and revokes all tokens associated with it. function optional The callback parameter looks like: Promise<void> Promises are supported in Manifest V3 and
chrome.processes
Use the chrome.processes API to interact with the browser's processes. number The part of the cache that is utilized, in bytes. number The size of the cache, in bytes. number optional The most recent measurement of the process's CPU usage, expressed
chrome.search
Use the chrome.search API to search via the default provider. "CURRENT_TAB" Specifies that the search results display in the calling tab or the tab from the active browser. "NEW_TAB" Specifies that the search results display in a new tab.
chrome.accessibilityFeatures
Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get feature states the extension
chrome.topSites
Use the chrome.topSites API to access the top sites (i.e. most visited sites) that are displayed on the new tab page. These do not include shortcuts customized by the user. You must declare the "topSites" permission in your extension's manifest to
chrome.printingMetrics
Use the chrome.printingMetrics API to fetch data about printing usage. "BLACK_AND_WHITE" Specifies that black and white mode was used. "COLOR" Specifies that color mode was used. "ONE_SIDED" Specifies that one-sided printing was used.
chrome.scripting
Use the chrome.scripting API to execute script in different contexts. To use the chrome.scripting API, declare the "scripting" permission in the manifest plus the host permissions for the pages to inject scripts into. Use the "host_permissions" key
chrome.extensionTypes
The chrome.extensionTypes API contains type declarations for Chrome extensions. The origin of injected CSS. "author" "user" Details of the CSS to remove. Either the code or the file property must be set, but both may not be set at the same time.
chrome.extensionTypes
The chrome.extensionTypes API contains type declarations for Chrome extensions. The origin of injected CSS. "author" "user" Details of the CSS to remove. Either the code or the file property must be set, but both may not be set at the same time.
Skip review for eligible changes
An overview of expedited review for Declarative Net Request changes.
Rollback a published Chrome Web Store item
How to rollback an extension that you previously published on the
Additional Requirements for Manifest V3
Extensions using Manifest V3 must meet additional requirements related to the extension's code. Specifically, the full functionality of an extension must be easily discernible from its submitted code, unless otherwise exempt as noted in Section 2.
chrome.privacy
Use the chrome.privacy API to control usage of the features in Chrome that can affect a user's privacy. This API relies on the ChromeSetting prototype of the type API for getting and setting Chrome's configuration. You must declare the "privacy"
Extensions / How to
Solve common development tasks around Chrome extensions
Mature & Sexually Explicit Material
We don't allow content that contains nudity, graphic sex acts, sexually explicit material, or content that drives traffic to commercial pornography sites. We also don't allow content that promotes incest, bestiality, necrophilia, or non-consensual
chrome.location
The chrome.location API is no longer supported. We recommend using open web alternatives such as the Geolocation API instead.
Register your developer account
How to register as a Chrome Web Store developer.
Trader/Non-Trader developer identification and verification
Developer's requirement to disclose and verify their trader/non-trader status.
Extensions / Samples
Samples Explore samples from the Chrome Extension samples repository. Use these to learn how extensions work or as starting points for building your own extensions. action.disable action.enable action.getBadgeBackgroundColor action.getBadgeText
Permissions
A list of permissions and user warnings available on the extensions platform.
Program Policies
The Web Store program policies.
Real-time Updates in Extensions
Managing real-time updates in Extensions
Distribute your extension
How to host your Chrome extension.
Extensions / Reference
Reference for the extensions manifest, related permissions and APIs
Extensions / Manifest V3
Manifest V3 Manifest V3 is the latest version of the extensions platform. We have made a number of changes to the available APIs and added a number of new features. Manifest V3 aims to be the first step in our platform vision to improve the privacy,
chrome.webstore
As of 06/12/2018, inline installation is deprecated. For more information, read our Chromium Blog post and Migration FAQ.
User interface components
A catalog of user interface elements available in extensions.
Set up your developer account
How to set up your Chrome Web Store developer account.
Prepare your extension
Prepare your extension files.
Support and feedback
Give us feedback to help us improve the platform and fix its bugs.
Submit a feature request
Submit a request for a feature that you believe could improve the extension platform.
Storage and cookies
Overview of how web storage APIs and cookies work in extensions.
Use your Google Analytics account with the Chrome Web Store
See analytics for your Chrome Web Store listing in addition to the metrics offered in the Developer Dashboard.
Design a superior user experience with the new Side Panel API
Introducing the new Side Panel API for Chrome extensions.
Manifest V3 migration checklist
A quick reference for upgrading your extensions from Manifest V2 to Manifest V3.
Test service worker termination with Puppeteer
A guide explaining how to test service worker termination using Puppeteer.
Affiliate Ads FAQ
Frequently asked questions about Chrome Web Store's policies on affiliate ads.
Affiliate Ads
Any affiliate program must be described prominently in the product's Chrome Web Store page, user interface, and before installation. Related user action is required before the inclusion of each affiliate code, link, or cookie. Some example violations
Chrome Extensions: Extending API to support Instant Navigation
The Extensions API has been updated to support back/forward cache, preloading navigations.
Handling Requirements
If your product is associated with a security vulnerability that could be exploited to compromise another application, service, browser, or system, we may remove your product from the Chrome Web Store and take other measures to protect users. In such
Misleading or Unexpected Behavior
We do not allow products that deceive or mislead users, including in the content, title, description, or screenshots. If any of your product's content, title, icon, description, or screenshots contains false or misleading information, we may remove
Featured Products
The Chrome Web Store features products that align with our standards, values, and that we believe will produce valuable user experiences. Certain products that don't meet these standards, but which do not explicitly violate Chrome Web Store
Minimum Functionality
Do not post an extension with a single purpose of installing or launching another app, theme, webpage, or extension. Extensions with broken functionality—such as dead sites or non-functioning features—are not allowed. Extensions must provide a basic
Accepting Payment From Users
If you collect sensitive personal information through your Product for sales, you must follow these requirements: You must securely collect, store, and transmit all credit card and other sensitive personal information in accordance with privacy and
Disclosure Requirements
You must be transparent in how you handle user data (e.g., information provided by a user or collected about a user or a user's use of the Product or Chrome Browser), including by disclosing the collection, use, and sharing of the data. If your
Malicious and Prohibited Products
Don't transmit viruses, worms, defects, Trojan horses, malware, or any other products of a destructive nature. We don't allow content that harms or interferes with the operation of the networks, servers, or other infrastructure of Google or any
Privacy Policies
If your Product handles any user data, then you must post an accurate and up to date privacy policy. The privacy policy must, together with any in-Product disclosures, comprehensively disclose: How your Product collects, uses and shares user data All
Code Readability Requirements
Developers must not obfuscate code or conceal functionality of their extension. This also applies to any external code or resource fetched by the extension package. Minification is allowed, including the following forms: Removal of whitespace,
Use of Permissions
Request access to the narrowest permissions necessary to implement your Product's features or services. If more than one permission could be used to implement a feature, you must request those with the least access to data or functionality. Don't
Enforcement Circumvention
Any attempt to circumvent intended limitations or enforcement actions will result in the immediate termination of your developer account, and possibly related developer accounts.
Impersonation & Intellectual Property
Don't pretend to be someone else, and don't represent that your product is authorized by, endorsed by, or produced by another company or organization, if that is not the case. Your Product and its user experience also must not mimic functionality or
API Use
Extensions must use existing Chrome APIs for their designated use case. Use of any other method, for which an API exists, would be considered a violation. For example, overriding the Chrome New Tab Page through any means other than the URL Overrides
Ads
Ads are considered part of your Product for purposes of content review and compliance with developer terms, and therefore must comply with the above content policies. Ads which are inconsistent with the content rating of your products or extension
Regulated goods and services
Don't engage in or promote unlawful activities in your product, such as rape, illegal sex work, or the sale of prescription drugs without a prescription. We will remove content which promotes, glorifies, or encourages dangerous or illegal activity
Hate Speech and Violent Behavior
Depictions of gratuitous violence are not allowed. Products should not contain materials that threaten, harass, or bully other users. We don't allow content or products that advocating against or inciting hatred towards groups of people based on
Notification and appeals
In the event that your Product is removed from the Chrome Web Store, you will receive an email notification to that effect, with further instructions if applicable. Verify that the associated publisher account with your Product can receive emails
2-Step Verification
To ensure the security of Chrome Web Store accounts, 2-Step Verification is required for all developer accounts prior to publishing an extension or updating an existing extension. Developers can activate 2-Step Verification for their Google accounts
Repeat Abuse
Serious or repeated violations of the Chrome Web Store Distribution Agreement or these Program Policies will result in the suspension of your developer account, and possibly related developer accounts. Additionally, you may be banned from using the
Chrome Apps
To ensure a great user experience, Chrome Apps distributed through the Chrome Web Store must follow the additional quality guidelines listed below. The guidelines in this section apply only to Chrome Apps. Packaged apps should: Take advantage of the
Spam and Abuse
We don't allow any developer, related developer accounts, or their affiliates to submit multiple extensions that provide duplicate experiences or functionality on the Chrome Web Store. Extensions should provide value to users through the creation of
Limited Use
This policy establishes the Chrome Web Store's minimum user data privacy requirements; you or your Product must comply with applicable laws. You must limit your use of the data to the practices you disclosed. Collection and use of web browsing
Known issues when migrating to Manifest V3
Recently, we announced changes to the Manifest V2 deprecation timeline, and while we remain firmly committed to Manifest V3 we acknowledge there is more work to do on our part. We are committed to closing the following gaps before announcing a new
Discovery on the Chrome Web Store
An overview of how users find items on the Chrome Web Store, and how our editors select items to feature.
Chrome Web Store review process
An overview of the review process and how enforcement actions result from detected policy violations.
Manifest V2 support timeline
Details of the Manifest V2 phase-out and end of life.
Analyze your store listing metrics
Understanding metrics and performance of your Chrome Web Store store listing.
Manage user feedback
Follow-up on reviews and provide user support in the Chrome Web Store.
Check on your review status
How to check the review status of your Chrome Web Store item.
Cross-origin isolation
Overview of cross-origin isolation for extensions
Enterprise publishing options
How to distribute extensions to enterprise users
Extension actions in Manifest V3
Chrome extensions had Browser and Page Actions APIs for years, but Manifest V3 replaced both with a generic Actions API. This post explores the history of these APIs and what has changed in Manifest V3.
Introducing chrome.scripting
The Scripting API is a new Manifest V3 API focused on, well, scripting. Let's dig into the motivations for this change and how it's different.
Extension Manifest Converter
Open source tool to convert extensions to Manifest V3. You'll still need to manually update any code with non-mechanical changes, such as adapting to use service workers or some script injection.
Web Accessible Resources for Manifest V3
Web Accessible Resources for Manifest V3 is here! Now `manifest.json` supports permission definitions. Developers can restrict resources based on the requesting site origin or extension id.
Complete your listing information
How to add listing information for your Chrome Web Store item.
Prepare to publish: set up payment and distribution
How to choose which countries will list your item and who will see it in the Chrome Web Store.
Update your Chrome Web Store item
How to update an extension or theme ("item") that you previously published on the Chrome Web Store.
Troubleshooting Chrome Web Store violations
Guidelines for understanding why an item was rejected or removed from the Chrome Web Store and how to fix the problem.
Chrome Web Store payments deprecation
Why the payments is deprecated, details about the deprecation timeline, and more.
Deleting Chrome Web Store developer accounts
How to delete a developer or group publisher account on the Chrome Web Store.
Set up a group publisher
How to share ownership of your Chrome Web Store items with other developers.
Fill out the privacy fields
Use the privacy practices tab to help the Chrome Web Store team review your extension as quickly as possible.
Spam policy FAQ
Frequently asked questions about Chrome Web Store's spam policy.
Supplying Images
Guidelines about the kinds of images you need to supply to the Chrome Web Store.
Branding Guidelines
Guidelines for use of Google trademarks.
Best Practices
How to create a high-quality extension and Chrome Web store listing.
Trader FAQ: Chrome Web Store
Frequently asked questions about Chrome Web Store's user data policy.
Updated Privacy Policy & Secure Handling Requirements
Frequently asked questions about Chrome Web Store's user data policy.
Media Source Extensions for Audio
Media Source Extensions (MSE) provide extended buffering and playback control for the HTML5 audio and video elements. While originally developed to facilitate Dynamic Adaptive Streaming over HTTP (DASH) based video players, MSE can be used for audio; specifically for gapless playback.
What is the Chrome Web Store?
An explanation of the Chrome Web Store and why you might want to use it.
Publish in the Chrome Web Store
How to publish a new extension or theme to the Chrome Web Store.
Google Chrome Web Store Developer Agreement
The legal agreement governing the relationship between Chrome Web Store developers and the Chrome Web Store.
Content Ratings Guidelines
Guidelines about how the Chrome Web Store rates the maturity of content.
Cross-origin XMLHttpRequest
How to implement cross-origin XHR in your Chrome Extension.
Localization message formats
Reference documentation about the format of the messages.json file for Chrome Extensions.