RickyAYoder RickyAYoder - 1 month ago 9
Javascript Question

How to load/build Chrome App/Extension and run programmatically

I'm looking to make a Chrome App similar to Google's own Chrome Dev Editor, an application built using web standards to create Chrome Apps/Extensions

In Chrome Dev Editor, it's possible to run the Chrome apps/extensions you create right within the app itself. It builds the apps and executes them.

Is there a specific API to do this for the app I want to make? If so what is it and where is the documentation for it?

Any guidance on this subject would be appreciated.

Thank you!
-Rick

Answer

Chrome Dev Editor is whitelisted for the chrome.developerPrivate api. You cannot deploy an app with this capability to the webstore.

Fortunately, you can use this api by loading as an unpacked extension, adding the "developerPrivate" and "management" permissions, and setting the key manifest property to one of those whitelisted keys.

If your users are Chrome app/extension developers, they will be familiar with loading unpacked extensions, so you could ask them to do it themselves to access these features and distribute a version without those features to the webstore.

You can include an option to export the source and automatically insert a manifest key using chrome.runtime.getPackageDirectoryEntry(), and checking if chrome.developerPrivate is defined before using it in your code.

whitelisted keys:

  • Chrome Dev Editor: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2OvldPjAqgEboHyyZM7GpCMmGMSQ8aExOlQyOhN3C9fDRXqnAN/Ie20TEwD9Eb2CciV3Ru4Gm7PmDnkHzsljD84qLgBdN39FzPGDyViXTS442xTElWRZMZQfJYQpbMpiePL720kTHgLLAcwTgdP9DnvRPrKukIs/U4Y76NFk7NNbsNOc6FWisLJykw2POTB1RR5ZlZrA4Ax1P7kt7qQdomE6i8wy1TA1jDhG8AhEXKRfpyELvJmzyVIyR9uiSHDHCdihiS5oyjADjmmbklvL7Ns0cSAgEX/lWN8UX8r17zoKZzJ0MkmCQ5Nlfql8qUtn2oZXaHztkkAcXCxkq9/37QIDAQAB"

  • Spark (dev): "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiC2CjQDYZcE1Pn8QHpLh1F32QiJqcO63CObY4ulPEHHmIDfIyflB2WXc7D1bDJtHBahkJEtHY4I8wN8gjowgYVKiiqMpwiuV7Evivyf7Qyvg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