diff options
Diffstat (limited to 'chrome/common/extensions/docs/templates/articles/faq.html')
-rw-r--r-- | chrome/common/extensions/docs/templates/articles/faq.html | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/chrome/common/extensions/docs/templates/articles/faq.html b/chrome/common/extensions/docs/templates/articles/faq.html index 9cec4d9..0539c56 100644 --- a/chrome/common/extensions/docs/templates/articles/faq.html +++ b/chrome/common/extensions/docs/templates/articles/faq.html @@ -275,10 +275,11 @@ cros,beta,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,#####</pre> <h3 id="faq-lifecycle-events">Can extensions be notified when they are installed/uninstalled?</h3> <p> - No, there are no events an extension can listen to in order to determine - whether it has been installed or uninstalled. However, an extension can - determine when it has been run for the first time. See <a - href="#faq-firstrun">this FAQ entry</a> for information. + You can listen to the + <a href="runtime.html#event-onInstalled">runtime.onInstalled</a> + event to be notified when your extension is installed or updated, or when + Chrome itself is updated. There is no corresponding event for when your + extension is uninstalled. </p> @@ -351,21 +352,11 @@ cros,beta,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,#####</pre> <h3 id="faq-firstrun">How can an extension determine whether it is running for the first time?</h3> <p> - An extension can check to see whether it is running for the first time by - checking for the presence of a value in localStorage, and writing the value if - it does not exist. For example: + You can listen to the + <a href="runtime.html#event-onInstalled">runtime.onInstalled</a> + event. See <a href="#faq-lifecycle-events">this FAQ entry</a>. </p> -<pre>var firstRun = (localStorage['firstRun'] == 'true'); -if (!firstRun) { - localStorage['firstRun'] = 'true'; -}</pre> - -<p> - Note that this check should be run in a background page, not a content script. -</p> - - <h2>Features and bugs</h2> @@ -483,4 +474,4 @@ if (!firstRun) { to the ticket you starred or opened. This will make it easier for others with the same request to find the correct ticket. </li> -</ol>
\ No newline at end of file +</ol> |