Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Extension Features Files | 1 # Extension Features Files |
| 2 | 2 |
| 3 [TOC] | 3 [TOC] |
| 4 | 4 |
| 5 ## Summary | 5 ## Summary |
| 6 | 6 |
| 7 The Extension features files specify the different requirements for extension | 7 The Extension features files specify the different requirements for extension |
| 8 feature availability. | 8 feature availability. |
| 9 | 9 |
| 10 An **extension feature** can be any component of extension capabilities. Most | 10 An **extension feature** can be any component of extension capabilities. Most |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 The accepted values are lists of strings from `chromeos`, `mac`, `linux`, and | 253 The accepted values are lists of strings from `chromeos`, `mac`, `linux`, and |
| 254 `win`. | 254 `win`. |
| 255 | 255 |
| 256 ### whitelist | 256 ### whitelist |
| 257 | 257 |
| 258 The `whitelist` property specifies a list of ID hashes for extensions that | 258 The `whitelist` property specifies a list of ID hashes for extensions that |
| 259 are the only extensions allowed to access a feature. | 259 are the only extensions allowed to access a feature. |
| 260 | 260 |
| 261 Accepted values are lists of id hashes. | 261 Accepted values are lists of id hashes. |
| 262 | 262 |
| 263 ## Feature Contexts | |
| 264 | |
| 265 A Feature Context is the type of JavaScript context that a feature can be made | |
| 266 available in. This allows us to restrict certain features to only being | |
| 267 accessible in more secure contexts, or to expose features to contexts outside | |
| 268 of extensions. | |
| 269 | |
| 270 For each of these contexts, an "extension" context can refer to a context of | |
| 271 either an app or an extension. | |
| 272 | |
| 273 ### Blessed Extension Contexts | |
| 274 | |
| 275 The `blessed_extension` context refers to a JavaScript context running from an | |
| 276 extension process. These are typically the most secure JavaScript contexts, as | |
| 277 it reduces the likelihood that a compromised web page renderer will have access | |
| 278 to secure APIs. | |
| 279 | |
| 280 Traditionally, only pages with a top-level extension frame (with a | |
| 281 `chrome-extension://` scheme), extension popups, and app windows were blessed | |
| 282 extension contexts. With site isolation, extension frames running in web pages | |
|
lazyboy
2016/08/24 17:48:26
link to "site isolation" -> https://www.chromium.o
Devlin
2016/08/25 17:12:58
Done.
| |
| 283 are also considered blessed extension contexts, since they are running in the | |
| 284 extension process (rather than in the same process as the web page). | |
| 285 | |
| 286 ### Blessed Web Page Contexts | |
| 287 | |
| 288 The `blessed_web_page` context refers to a JavaScript context running from a | |
| 289 hosted app. These are similar to blessed extension contexts in that they are | |
| 290 (partially) isolated from other processes, but are typically more restricted | |
| 291 than blessed extension processes, since hosted apps generally have fewer | |
| 292 permissions. Note that these contexts are unaffected by the `matches` property. | |
| 293 | |
| 294 ### Content Script Contexts | |
| 295 | |
| 296 The `content_script` context refers to a JavaScript context for an extension | |
| 297 content script. Since content scripts share a process with (and run on the same | |
| 298 content as) web pages, these are considered very insecure contexts. Very few | |
| 299 features should be exposed to these contexts. | |
| 300 | |
| 301 ### Service Worker Contexts | |
| 302 | |
| 303 The `extension_service_worker` context refers to a JavaScript context for an | |
| 304 extension's service worker. An extension can only register a service worker for | |
| 305 it's own domain, and these should only be run within an extension process. Thus, | |
|
Devlin
2016/08/23 23:21:33
lazyboy@, can you confirm this is true?
lazyboy
2016/08/24 17:48:26
Yes.
| |
| 306 these have similar privilege levels to blessed extension processes. | |
| 307 | |
| 308 ### Web Page Contexts | |
| 309 | |
| 310 The `web_page` context refers to a JavaScript context for a simple web page, | |
| 311 completely separate from extensions. This is the least secure of all contexts, | |
| 312 and very few features should be exposed to these contexts. When specifying this | |
| 313 context, an accompanying URL pattern should be provided with the `matches` | |
| 314 property. | |
| 315 | |
| 316 ### WebUI Contexts | |
| 317 | |
| 318 The `webui` context refers to a JavaScript context for a page with WebUI | |
| 319 bindings, such as internal chrome pages like chrome://settings or | |
| 320 chrome://extensions. These are considered secure contexts, since they are | |
| 321 an internal part of chrome. When specifying this context, an accompanying URL | |
| 322 pattern should be provided with the `matches` property. | |
| 323 | |
| 324 ### Unblessed Extension Contexts | |
| 325 | |
| 326 The `unblessed_extension` context refers to a JavaScript context for an | |
| 327 extension frame that is embedded in an external page, like a web page, and | |
| 328 runs in the same process as the embedder. Given the limited separation between | |
| 329 the (untrusted) embedder and the extension frame, relatively few features are | |
| 330 exposed in these contexts. Note that with site isolation, extension frames (even | |
| 331 those embedded in web pages) run in the trusted extension process, and become | |
| 332 blessed extension contexts. | |
| 333 | |
| 263 ## Still to come | 334 ## Still to come |
| 264 | 335 |
| 265 TODO(devlin): Move documentation for how to create ID hashes, possibly move | 336 TODO(devlin): Move documentation for how to create ID hashes, add documentation |
| 266 documentation for feature contexts, add documentation for extension types, and | 337 for extension types, and add documentation for the compilation process. Probably |
| 267 add documentation for the compilation process. Probably also more on | 338 also more on requirements for individual features. |
| 268 requirements for individual features. | |
| OLD | NEW |