0Pricing
Browser Extensions Development (Chrome & Edge) · 课时

面向多个商店的打包与发布

学习如何将单一扩展代码库打包,并同时提交到 Chrome Web Store 和 Microsoft Edge Add-ons 商店。

面向多个商店的打包与发布 是 CoddyKit 上的免费 Browser Extensions Development (Chrome & Edge) 课时。 这是第 4 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 Browser Extensions Development (Chrome & Edge) 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 Browser Extensions Development (Chrome & Edge) 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

Why Publish to Multiple Stores

Once your extension works across browsers, the next step is distribution. The two largest Chromium stores are the Chrome Web Store and the Microsoft Edge Add-ons store.

Publishing to both maximizes reach with almost no extra code, since both consume the same Manifest V3 package.

One Codebase, Two Packages

You usually ship the same ZIP to both stores. Small differences (like minimum versions or store-specific keys) can be handled with a build script.

  • Keep one source tree
  • Produce store-specific builds via scripts
  • Avoid maintaining forks
{
  "manifest_version": 3,
  "name": "My Extension",
  "version": "1.4.0",
  "minimum_chrome_version": "102"
}

Building the ZIP

Stores accept a ZIP archive of your extension root (the folder containing manifest.json). Never zip the parent folder.

A simple npm script keeps this repeatable.

node -e "const cp=require('child_process'); cp.execSync('cd dist && zip -r ../extension.zip .')"
console.log('Created extension.zip');

Version Numbers Matter

Both stores require the version in the manifest to be strictly higher than the currently published version for each update.

Use semantic-like dotted numbers: 1.4.0 then 1.4.1.

const fs = require('fs');
const m = JSON.parse(fs.readFileSync('manifest.json', 'utf8'));
const parts = m.version.split('.').map(Number);
parts[parts.length - 1] += 1;
m.version = parts.join('.');
fs.writeFileSync('manifest.json', JSON.stringify(m, null, 2));
console.log('Bumped to', m.version);

Chrome Web Store Submission

In the Chrome Developer Dashboard you upload the ZIP, fill listing details (description, screenshots, category) and submit for review.

  • One-time developer registration fee
  • Automated plus manual review
  • Permission justifications required

Edge Add-ons Submission

The Partner Center hosts Edge submissions. Registration is free. You upload the same ZIP and provide listing metadata.

Edge review tends to focus on policy compliance and accurate descriptions.

Store Listing Assets

Both stores need marketing assets:

  • Icon (128x128)
  • Screenshots (1280x800 recommended)
  • A small and large promo tile (optional)
  • Short and detailed descriptions

Prepare these once and reuse across stores.

Automating with the CWS API

The Chrome Web Store API lets you upload and publish from CI. You authenticate with OAuth and call the REST endpoints.

// Pseudocode using fetch in a CI script
const token = await getAccessToken();
await fetch('https://www.googleapis.com/upload/chromewebstore/v1.1/items/' + itemId, {
  method: 'PUT',
  headers: { Authorization: 'Bearer ' + token, 'x-goog-api-version': '2' },
  body: zipBuffer
});
console.log('Uploaded to CWS');

Automating Edge Submissions

Edge offers the Add-ons API for CI uploads. You obtain an access token, upload the package, then trigger publishing.

This mirrors the Chrome flow, so a shared deploy script can target both.

// Upload draft, then publish
await fetch(baseUrl + '/products/' + productId + '/submissions/draft/package', {
  method: 'POST',
  headers: { Authorization: 'Bearer ' + token },
  body: zipBuffer
});
console.log('Edge draft uploaded');

Handling Review Rejections

Common rejection causes:

  • Requesting permissions you do not use
  • Vague privacy disclosures
  • Mismatched description and behavior

Request only the minimum permissions and document why each is needed.

Keeping Both Stores in Sync

To avoid drift, publish from a single tagged release. Tag the commit, build the ZIP, then push to both stores in the same pipeline run.

This guarantees identical behavior for all your users.

Quick Check

Test your understanding of multi-store publishing.

Recap

You learned to package one codebase and ship it to both Chromium stores:

  • Zip the extension root, never the parent folder
  • Bump the version on every update
  • Reuse listing assets across stores
  • Automate uploads with the CWS and Edge APIs
  • Request minimal permissions to ease review

常见问题解答

「面向多个商店的打包与发布」课时是免费的吗?

是的 — 「面向多个商店的打包与发布」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 Browser Extensions Development (Chrome & Edge) 课程的其余内容,请升级到 CoddyKit PRO。 Browser Extensions Development (Chrome & Edge) 课程共包含 4 节课。

「面向多个商店的打包与发布」这节课中我会学到什么?

学习如何将单一扩展代码库打包,并同时提交到 Chrome Web Store 和 Microsoft Edge Add-ons 商店。 你通过在浏览器中直接运行的动手代码来练习 Browser Extensions Development (Chrome & Edge),全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 Browser Extensions Development (Chrome & Edge) 需要有经验吗?

无需任何先前经验。CoddyKit 上的 Browser Extensions Development (Chrome & Edge) 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 4 节课,共 4 节。

「面向多个商店的打包与发布」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 Browser Extensions Development (Chrome & Edge) 课中编写并运行代码吗?

能。每节 Browser Extensions Development (Chrome & Edge) 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. 跨浏览器清单调整
  2. 使用 WebExtension 兼容填充
  3. 探索扩展开发框架
  4. 面向多个商店的打包与发布
← 返回 Browser Extensions Development (Chrome & Edge)