mozilla/snippets — pull request #4 by Osmose (2013-03-07 22:03:09+00:00)
Title: Update standard-js snippet to handle geolocated snippets.

Geolocated snippets have an extra data attribute, data-country, that
determines which country they should be available to. The JS should
use the geolocation service at geo.mozilla.org to determine the user's
country, and include snippets targeted at that country in the set of
possible snippets.

To avoid excessive traffic, we cache the user's country in localStorage
for 30 days. In addition, we only download the user's country AFTER
snippets are displayed; the geolocated snippets will show up next time
the user hits about:home, and we avoid any delay in showing a snippet
if the geolocation service is down.