问题
I'm just wondering how the Chrome Web Store is implemented. There is a web site that has an option to LAUNCH APP
. What happens when that button is clicked. How does it go about launching the extension?
You can find the Chrome Signal Application here
回答1:
Chrome uses an internal extension to grant special permissions to that page (namely "webstorePrivate" and "management"). There's not much to it in Chrome proper:
- The manifest for webstore_app is at https://cs.chromium.org/chromium/src/chrome/browser/resources/webstore_app/manifest.json
- The management API is documented at https://developer.chrome.com/extensions/management, since it's usable by other extensions
- The webstorePrivate API is not documented except at https://cs.chromium.org/chromium/src/chrome/common/extensions/api/webstore_private.json, since it's not usable by other extensions.
All the code that actually calls these APIs is served from Google's servers for the web store page itself. As a starting point, if you open the developer tools on the Chrome web store and type chrome.runtime.id
, it will respond with "ahfgeienlihckogmohjhadlkjgocpleb"
.
来源:https://stackoverflow.com/questions/43857228/what-is-the-method-the-chrome-web-store-uses-to-launch-an-application