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 25 Reputation points
2023-11-01T05:20:38.87+00:00

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.
2,144 questions
{count} vote

3 answers

Sort by: Most helpful
  1. Wenying Lu-MSFT 1,585 Reputation points Microsoft Vendor
    2023-11-01T10:52:50.1233333+00:00

    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.

    Regards,

    Wenying Lu


  2. AITOPIA 0 Reputation points
    2024-01-17T22:05:47.4533333+00:00

    Hello, Unfortunately, although we did all the steps as it is instructed with key.pem, it did not work. Our Edge extension id has been created independently from our existing Chrome extension id. What can we do? Is there any email or form to submit all the details as a case and get a solution? Thanks for all your help. Best

    0 comments No comments

  3. Gwennie 0 Reputation points
    2024-01-18T05:44:08.58+00:00

    I recently ported a working Chrome Web Store extension to the Microsoft Edge Extension Web Store. During this process, Microsoft Edge generated a different extension ID compared to the one assigned by Chrome. It's important to note that the same zip file containing the extension, including the manifest.json, key.pem, app.crx, and other necessary JavaScript files, is used for both the Chrome and Microsoft Edge versions of the extension. I've gone thru most of the documentation (if not all) I could find on the support page. We also followed the steps mentioned in this thread but unfortunately did not work. How can we synchronize the extension ID between these two platforms?