This is a very tiny post pointing out to an existing chrome app development guide about testing chrome extension with respect to install and update flows. These testing may become tricky because during the development stage we use Unpacked extensions. With this method, we may not get to test the actual install and update flows as the related event will not be fired.
For instance, it's hard to test the permission flow when using the unpacked extension. We might include new permission into our manifest and need to test before pushing into the web store.
There is a way to test such scenarios. We can pack the extension locally (into a
.crx file) and install our actual extension from a local file (using
.crx format of the extension). So that, the chrome will treat it as a normal install. Thus, we can test all the install as well as update workflows.
This section of the chrome extension development guide walk through the process of:
- Creating a
.crxfile (extension source) and
.pemfile (private key) for your extension
- Installing the
.crxfile into Chrome
- Simulating the update process using the
.pemfile. If the extension is loaded without a
.pemfile, it will be acted as a new install and if we load with an existing
.pemfile, the loaded
.crxfile will be treated as an update to an existing extension (if exists)
This section will be focused on the permission part we saw as an example. Hope this helps in deploying your extension with confidence.
Always have a staging build for your extension such as a separate webstore extension visible only to testers. Publish new builds to the test extension before making it live. I bet it will save you from a ton of awkwardness. It helped me a lot 😉