Use the chrome.app.runtime module to manage the app lifecycle. The app runtime manages app installation, controls the event page, and can shut down the app at anytime.

Related Documentation