移植扩展Port your extension

Microsoft Edge 允许你以最少的更改移植 Chrome 扩展。Microsoft Edge allows you to port your Chrome extension with minimal changes. Chrome 支持的扩展 API 和清单密钥与 Microsoft Edge 代码兼容。The Extension APIs and manifest keys supported by Chrome are code-compatible with Microsoft Edge. 有关 Microsoft Edge 支持的 API 列表,请导航到 API 支持For a list of APIs supported by Microsoft Edge, navigate to API support.

若要移植 Chrome 扩展,请完成以下步骤。To port your Chrome extension, complete the following steps.

  1. 使用 Microsoft Edge 扩展支持的 API 列表查看扩展中使用的 Chrome扩展 API。Review the Chrome extension APIs used in your extensions with the Microsoft Edge extensions supported APIs list.

    备注

    如果你的扩展使用 Microsoft Edge 不支持的 API,它可能不会直接移植。If your extension uses APIs that are not supported by Microsoft Edge, it may not port directly.

  2. 在清单文件中,将 update_URL 字段设置为 https://edge.microsoft.com/extensionwebstorebase/v1/crxIn the manifest file, set the update_URL field to https://edge.microsoft.com/extensionwebstorebase/v1/crx. 值指向 Microsoft Edge 加载项存储中的扩展文件,并允许 .crx Microsoft Edge 检查扩展更新。The value points to the .crx file of your extension in the Microsoft Edge Add-ons store and allows Microsoft Edge to check for extension updates.

  3. 如果在 Chrome 扩展的名称或说明中使用的,则使用 重新命名扩展 Microsoft EdgeIf Chrome is used in either the name or the description of your extension, rebrand your extension using Microsoft Edge. 若要通过认证过程,需要更改。To pass the certification process, the changes are required.

  4. 通过旁加载扩展来测试扩展,以检查它在 Microsoft Edge 中是否正常工作Test your extension to check if it works in Microsoft Edge by sideloading your extension.

  5. 如果面临任何问题,可以使用 DevTools 在 Microsoft Edge 中调试扩展,或 联系我们If you face any issues, you may debug your extensions in Microsoft Edge by using the DevTools, or contact us.

  6. 按照 发布指南在 Microsoft Edge 加载项应用商店中发布扩展。Follow the publishing guidelines to publish your extension on Microsoft Edge Add-ons store.

    备注

    如果扩展使用 与本机应用交换邮件,请确保在本机消息传递主机清单 chrome.runtime.connectNative allowed_origins extension://[Microsoft-Catalog-extensionID] 文件中设置为 。If your extension exchanges messages with a native app using chrome.runtime.connectNative, ensure that you set allowed_origins to extension://[Microsoft-Catalog-extensionID] in your native messaging host manifest file. 该设置允许应用标识你的扩展。The setting allows the app to identify your extension.

后续步骤Next steps

准备好在 Microsoft Edge 加载项应用商店中发布扩展包后,创建开发人员帐户发布扩展After your extension package is ready to publish in the Microsoft Edge Add-ons store, create a developer account and publish your extension.