Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Extension and App Types | |
| 2 | |
| 3 Generally, browser extensions cut across websites and web apps, while apps | |
| 4 provide more isolated functionality. | |
| 5 | |
| 6 [TOC] | |
| 7 | |
| 8  | |
| 9 | |
| 10 ## Browser extensions | |
| 11 | |
| 12 Unlike apps, a browser extension creates an icon in the Chrome toolbar, which | |
| 13 may be interactive when `browser_action` or `page_action` manifest keys are | |
| 14 used. | |
| 15 | |
| 16 Furthermore, browser extensions can be granted permission to read or modify: | |
| 17 | |
| 18 * web page content | |
| 19 * cookies | |
| 20 * downloads | |
|
Devlin
2017/02/21 14:05:10
This list is very inexhaustive. I wonder if we sh
michaelpg
2017/02/21 23:50:39
Shortened to be less specific.
| |
| 21 | |
| 22 `Extension` is also the class type for all extensions and apps, so technically | |
|
Devlin
2017/02/21 14:05:10
This is pretty nitty-gritty, and is really a code
michaelpg
2017/02/21 23:50:39
yeah, i've moved this to the end.
| |
| 23 speaking, an app *is-an* `Extension`. Usually, the word "extension" refers only | |
| 24 to non-app extensions, a.k.a. *browser extensions*. | |
| 25 | |
|
Devlin
2017/02/21 14:05:10
Do we want to document shared modules or converted
michaelpg
2017/02/21 23:50:39
Feel free! (I didn't even know about converted use
| |
| 26 ## Apps | |
| 27 | |
| 28 ### Platform app | |
| 29 | |
| 30 Platform apps (*v2 packaged apps*) have `app.background.page` and/or | |
|
Devlin
2017/02/21 14:05:10
Here, too, I'd start with something more fundament
michaelpg
2017/02/21 23:50:40
Done.
| |
| 31 `app.background.scripts` manifest keys. The background page and scripts are | |
| 32 loaded when the platform app is enabled; they usually listen to the | |
| 33 `chrome.app.runtime.onLaunched` event to create platform app windows and do | |
| 34 app-y stuff. | |
| 35 | |
| 36 Unlike browser extensions, platform apps can connect to network sockets and | |
| 37 bluetooth, hid, and usb devices. | |
|
benwells
2017/02/20 23:57:02
Might want to add that these are deprecated on all
michaelpg
2017/02/21 23:50:39
Doh, yes indeed.
| |
| 38 | |
| 39 ### Packaged app (legacy) | |
| 40 | |
| 41 The idea behind [legacy (v1) packaged apps]( | |
| 42 https://developer.chrome.com/extensions/apps) was to combine the appearance of a | |
| 43 [hosted app](#Hosted-app) -- a windowed wrapper around a website -- with the | |
| 44 power of extension APIs. With the launch of platform apps and the app-specific | |
| 45 APIs, legacy packaged apps are deprecated. | |
| 46 | |
| 47 Legacy packaged apps have an `app.launch.local_path` manifest key. | |
| 48 | |
| 49 ### Hosted app | |
| 50 | |
| 51 A [hosted app](https://developer.chrome.com/webstore/hosted_apps) is mostly | |
| 52 metadata: a web URL to launch, a list of associated URLs, and a list of HTML5 | |
| 53 permissions. Chrome ask for these permissions during the app's installation, | |
|
Devlin
2017/02/21 14:05:10
Should we mention Chrome?
(also, typo, *asks)
michaelpg
2017/02/21 23:50:40
As opposed to "the browser" or something? (IIRC, C
| |
| 54 allowing the associated URL to bypass the normal Chrome permission prompts for | |
| 55 HTML5 features. | |
| 56 | |
| 57 ### Bookmark app | |
| 58 | |
| 59 A bookmark app is generated when the user taps "Add to desktop" (or "Add to | |
| 60 shelf" or Chrome OS) in the Chrome menu when visiting a web page or an extension | |
|
Rahul Chaturvedi
2017/02/17 22:28:55
s/or/on
benwells
2017/02/20 23:57:02
I think it is as it is?
michaelpg
2017/02/21 23:50:39
Done.
michaelpg
2017/02/21 23:50:39
The first "or" should be "on".
benwells
2017/02/22 06:46:49
Doh!
| |
| 61 page in a tab. This user action creates a barebones extension containing the | |
| 62 site's favicons and a manifest file with the `app.launch.web_url` key set to the | |
| 63 tab's URL. | |
| 64 | |
| 65 The icon Chrome creates on the desktop is simply a shortcut to Chrome, with the | |
| 66 `--profile-directory` and `--app-id` flags set. Activating the icon launches | |
| 67 the app in a tab or a window, depending on a setting in Preferences. | |
| 68 | |
| 69 The icon will also appear in chrome://apps (even if it points to another | |
| 70 extension already visible in chrome://apps). | |
| 71 | |
| 72 This kind of app is technically a hosted app. | |
|
benwells
2017/02/20 23:57:02
This is true but there are some little differences
michaelpg
2017/02/21 23:50:39
Reworked into the opening paragraph.
| |
| 73 | |
| 74 ## See also | |
| 75 | |
| 76 * [`Manifest::Type` declaration](https://cs.chromium.org/chromium/src/extensions /common/manifest.h?gs=cpp%253Aextensions%253A%253Aclass-Manifest%253A%253Aenum-T ype%2540chromium%252F..%252F..%252Fextensions%252Fcommon%252Fmanifest.h%257Cdef& gsn=Type&ct=xref_usages) | |
| 77 * Extensions (3rd-party developer documentation) | |
| 78 * [Extension APIs](https://developer.chrome.com/extensions/api_index) | |
| 79 * [Extension manifest file format]( | |
| 80 https://developer.chrome.com/extensions/manifest) | |
| 81 * Apps (3rd-party developer documentation) | |
| 82 * [Platform app APIs](https://developer.chrome.com/apps/api_index) | |
| 83 * [Platform app manifest file format]( | |
| 84 https://developer.chrome.com/apps/manifest) | |
| 85 * [Choosing an app type](https://developer.chrome.com/webstore/choosing) | |
| 86 * Ancient article introducing the [motivation for apps (outdated)]( | |
| 87 https://developer.chrome.com/webstore/apps_vs_extensions) | |
| OLD | NEW |