Labs/Jetpack/JEP/30A: Difference between revisions
Jump to navigation
Jump to search
| Line 26: | Line 26: | ||
=== Examples === | === Examples === | ||
<pre> | <pre class="brush:js;"> | ||
jetpack.onInstall(function(){ | jetpack.onInstall(function(){ | ||
jetpack.tabs.open("http://example.com/firstRun.html" ); | jetpack.tabs.open("http://example.com/firstRun.html" ); | ||
| Line 33: | Line 33: | ||
<pre> | <pre class="brush:js;"> | ||
jetpack.onInstall(function(){ | jetpack.onInstall(function(){ | ||
jetpack.notifications.show("Use the context menu, Luke!"); | jetpack.notifications.show("Use the context menu, Luke!"); | ||
}); | }); | ||
</pre> | </pre> | ||
Latest revision as of 02:01, 3 December 2009
JEP 30 - onInstall Event
- Champion: Aza Raskin <aza at mozilla dot com>
- Editors: Drew <drew at mozilla dot com>
- Status: Implementing
- Type: API Track
- Created: 2 Dec 2009
- Reference Implementation: None
- Relevant Bugs:
- JEP Index
Introduction and Rationale
This JEP describes an API for allowing Jetpack authors to do something upon first run.
After installing a Jetpack, without some sort of instructions on how to use the features just installed, the user can feel lost, bewildered, and confused. The first-time experience is exactly when users need the greatest reassurance and instruction, which is why so many Firefox add-ons create a first-run page to explain and guide the user through the new functionality. This is a stop-gap measure before we have a better version JEP 30.
Proposal
jetpack.onInstall(function)
Upon install of the Jetpack, this function gets called.
Examples
jetpack.onInstall(function(){
jetpack.tabs.open("http://example.com/firstRun.html" );
});
jetpack.onInstall(function(){
jetpack.notifications.show("Use the context menu, Luke!");
});