How can I ensure that the extension ID remains the same when publishing my browser extension for the first time on Chrome and Edge?

Sylvia lucy 20 Reputation points

I want to upload extension'zip with mainfest.json includes "key". But it show error.User's image

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
1,927 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenying Lu-MSFT 955 Reputation points Microsoft Vendor

    Hi @Sylvia lucy ,

    1.Once uploaded extension, your extension ID is fixed and cannot be changed any more.

    The ID is derived from the .pem file that was created the first time you packed the extension in a .crx file. When you load an extension in "unpacked mode", an ID is automatically generated in an unpredictable way.

    The only way to control the extension ID during development is by setting the "key" field in the manifest file, as the doc.

    2.You're ready to submit your app/extension to the extension Store, refer to the following steps:

    1)Create a zip file containing your extension (important: manifest.json must be at the root, i.e. "directory/manifest.json" is bad, "manifest.json" is good).

    • Add the .pem file as key.pem!
      (this is necessary to preserve the extension ID)
    • (Add) How to generate a key.pem! 1.Go to edge://extensions/ and enable Developer mode; 2.Click on "Pack extension...", select your app/extension's directory and confirm; 3.You've got a .crx file and a .pem file. Back up the private key (.pem file).

    2)Upload the extension to the Store (without the "key" field in manifest.json will reject any upload that contains a "key" field).

    For subsequent updates, "key.pem" should not be added to the zip file, because doesn't need it anymore.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    Wenying Lu

    0 comments No comments