Changes

Jump to: navigation, search

Labs/Jetpack/JEP/25

943 bytes added, 18:40, 15 September 2009
added another example
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.
 
=== XULRunner extension, sandboxing code ===
 
It's possible to use the Chrome Booster framework API to load semi-trusted code the same way that Jetpack does. While this probably won't be needed in most cases for extensions, it's still a potentially nice way to sandbox an extension to follow the principle of least privilege. It's conceivable that this could also lead to quicker AMO reviews: if the vast majority of an extension runs in a sandbox and uses trusted, secure Chrome Boosters, then it should be easier for a reviewer to verify that the extension isn't insecure.
 
<pre class="brush:js;">
var SecurableModule = {};
Components.utils.import("resource://some_extension/content/booster.js",
SecurableModule);
 
var loader = SecurableModule.Loader({
rootPath: "chrome://some_extension/content/lib"
});
 
loader.runScript({content: "require('foo').bar();",
capabilities: ["file:read"]});
</pre>
== Reference Implementation ==
874
edits

Navigation menu