9

I am trying to test my chrome extension on different machines, and I saw that the extension id changes every time since I am loading it as an unpacked extension.

But, I really need to maintain the same extension id. My extension goes through OAuth 2.0 with an external non-Google provider. When I registered my extension with the external provider, I had provided the redirect URI in the form of chrome-extension://<extension-id>/callback.html If I load the unpacked extension again, the id changes and my app no longer works as the redirect URI changes. It's practically unfeasible to keep changing the redirect URI. How do I maintain the same id?

llams48
  • 387
  • 2
  • 7
  • 16

1 Answers1

10

You need to set the key in the manifest file, based on your generated pem file.

There's instruction on getting the pem here: https://developer.chrome.com/extensions/packaging

And there's more detail on the key field here: https://developer.chrome.com/extensions/manifest/key

Make sure you save your pem file once you generate it! It can never be generated again, and you'll have to republish your app to get a new one.

Brian
  • 1,513
  • 2
  • 14
  • 17
  • 2
    Do note that you can also download a published extension, and the `key` field will be added to the manifest by CWS. It's not the same as having a private key, but at least you can copy it to the dev version. – Xan Jul 15 '15 at 07:54
  • There is no mention of pem file at the linked article now. It probably changed over time. – Flaiming Jun 13 '23 at 06:37