Firefox monitors the users region in order to show relevant local search engines and content. The region is tracked in 2 properties:

  • Region.current - The most recent location we detected for the user.

  • Region.home - Where we consider the users home location.

These are tracked separately as to avoid updating the users experience repeatedly as they travel for example. In general callers should use Region.home.

If the user is detected in a current region that is not there home region for a continuous period (current 2 weeks) then their home region will be updated.


To set the users region for testing you can use Region._setHomeRegion("US", false), the second parameter notify will send a notification that the region has changed and trigger a reload of search engines and other content.

Updating test_Region_geocoding.js data

The test data used in this test is generated by running the MLS geocoding service locally:

Follow the Ichnaea location development guide @

Make a list of test locations in a CSV format, for example:


You can use the MLS raw data files to get a large sample @

Save a script to run the geocoding in ichnaea/ichnaea

import geocode
geocoder = geocode.Geocoder()

f = open("mls.csv", "r")
r = open("mls-lookup-results.csv", "a")

for x in f:
  [lat, long] = x.strip().split(",")
  region = geocoder.region(lat, long)
  r.write("%s\n" % region)

Run the script

$ make shell
$ cd ichnaea
$ python

If you want to commit the new test data ~500 seems to be a reasonable number of data points to test before running into issues with the test length.