Chrome Web Store Install Notification

Mappeo.net, a geographic video search app, is one of my lab projects and I use it to try new techniques and technologies. Recently and to familiarize myself with the Google Chrome Web Store publishing process, I built a packaged version of mappeo and published on the Web Store.

Many Chrome Web Store apps are also available outside the store (like mappeo), and like me, you may want to notify visiting Chrome users that an optimized Chrome app is available.
Inspired by Jolicloud and Paul Kinlan’s badgemator, I created a javascript library to display an animated notification like the one below.

Chrome Notification Bar

The install button redirects the user to the Web Store install page for your app.
There’s also a nice CSS3 animation, visit mappeo.net with Chrome to check it out.

The window.chrome.app object is very handy to make sure we’re not showing the notification if the app is already running. Also, to prevent the notification bar reappearing for returning visitors, a cookie is used to save state.

if (navigator && navigator.userAgent && navigator.userAgent.indexOf('Chrome') != -1) {
  var isInstalled = window.chrome && window.chrome.app && window.chrome.app.isInstalled;
  var isCancelled = document.cookie.indexOf(cookie + "=true") >= 0;

  (...)
}

The library is small, has no dependencies and you can download it from the github repository (MIT license)