874
edits
(→XULRunner extension, in a chrome-privileged page/window: renamed section) |
(minor renamings to avoid confusion) |
||
Line 36: | Line 36: | ||
This code doesn't necessarily work; it's just aspirational. | This code doesn't necessarily work; it's just aspirational. | ||
=== Jetpack === | === Jetpack Feature === | ||
Using Chrome Boosters from a Jetpack Feature is just like using them in any CommonJS-supported environment; the Jetpack runtime takes care of initializing the Chrome Booster framework when a Jetpack Feature is loaded, providing all necessary global functions to the Feature's global scope, and unloading the Chrome Boosters when the Feature is unloaded. | Using Chrome Boosters from a Jetpack Feature is just like using them in any CommonJS-supported environment; the Jetpack runtime takes care of initializing the Chrome Booster framework when a Jetpack Feature is loaded, providing all necessary global functions to the Feature's global scope, and unloading the Chrome Boosters when the Feature is unloaded. | ||
Line 117: | Line 117: | ||
unloaded. | unloaded. | ||
=== Chrome Booster, exporting to Jetpack === | === Chrome Booster, exporting to a Jetpack Feature === | ||
A Chrome Booster can use the forthcoming ChromeObjectWrapper protocol to decide which properties it wants to export to untrusted or semi-trusted Jetpack code. | A Chrome Booster can use the forthcoming ChromeObjectWrapper protocol to decide which properties it wants to export to untrusted or semi-trusted Jetpack code. | ||
Line 131: | Line 131: | ||
In the above case, <tt>foo.bar()</tt> will be readable (but not writable) from Jetpacks that import the above module via a call to <tt>require()</tt>, but <tt>foo.baz</tt> will not be accessible at all. | In the above case, <tt>foo.bar()</tt> will be readable (but not writable) from Jetpacks that import the above module via a call to <tt>require()</tt>, but <tt>foo.baz</tt> will not be accessible at all. | ||
=== Chrome Booster, exporting to Jetpack with capabilities === | === Chrome Booster, exporting to a Jetpack Feature with capabilities === | ||
If a Jetpack has capabilities associated with it, a Chrome Booster should be able to introspect into them and provide attenuated functionality based on said capabilities: | If a Jetpack Feature has capabilities associated with it, a Chrome Booster should be able to introspect into them and provide attenuated functionality based on said capabilities: | ||
<pre class="brush:js;"> | <pre class="brush:js;"> | ||
Line 154: | Line 154: | ||
</pre> | </pre> | ||
Exactly how capabilities are specified for | Exactly how capabilities are specified for a Feature—e.g., whether done explicitly by Feature authors or implicitly via static analysis—is outside the scope of this document. | ||
Exactly ''what'' capabilities are available in Jetpack is also outside of the scope of this document, suffice to say that they will likely be developed organically: since the community will be creating Chrome Boosters that expose chrome functionality to semi-trusted content, we'll need to work together to figure out what the best capabilities are as the library of functionality is developed. | Exactly ''what'' capabilities are available in the Jetpack platform is also outside of the scope of this document, suffice to say that they will likely be developed organically: since the community will be creating Chrome Boosters that expose chrome functionality to semi-trusted content, we'll need to work together to figure out what the best capabilities are as the library of functionality is developed. | ||
== Reference Implementation == | == Reference Implementation == |
edits