private/initializers/dev-fixtures.js
function readOverlay(application) {
  var possibleValues, value;
  if (Ember.testing) {
    // when in test mode, use the overlay specified in the application
    value = {from: 'test:startApp()', name: application.get('devFixtures.overlay')};
  }
  else {
    // else try many locations
    possibleValues = [];
    location.href.replace(/(?:\?|&)FIXTURES_OVERLAY(?:=([^&#$]*))?(?:&|#|$)/, function (dummy, value) {
      value = value ? decodeURIComponent(value) : null;
      possibleValues.push({from: 'location.search:FIXTURES_OVERLAY', name: value});
    });
    possibleValues.push({
      from: 'file:config/environment.js',
      name: application.get('devFixtures.overlay')
    });
    possibleValues.push({
      from: 'localStorage:' + STORAGE_KEY,
      name: window.localStorage.getItem(STORAGE_KEY)
    });
    // grabbing the first one not undefined
    value = Ember.A(possibleValues).find(function (value) {
      return value !== undefined;
    });
    // saving it in the localStorage
    if (value && value.name) {
      window.localStorage.setItem(STORAGE_KEY, value.name);
    }
    else {
      window.localStorage.removeItem(STORAGE_KEY);
    }
  }
  // no overlay found anywhere
  if (!value) {
    value = {from: 'default', name: null};
  }
  return value;
}
function readOverlay(application) {
  var possibleValues, value;
  if (Ember.testing) {
    // when in test mode, use the overlay specified in the application
    value = {from: 'test:startApp()', name: application.get('devFixtures.overlay')};
  }
  else {
    // else try many locations
    possibleValues = [];
    location.href.replace(/(?:\?|&)FIXTURES_OVERLAY(?:=([^&#$]*))?(?:&|#|$)/, function (dummy, value) {
      value = value ? decodeURIComponent(value) : null;
      possibleValues.push({from: 'location.search:FIXTURES_OVERLAY', name: value});
    });
    possibleValues.push({
      from: 'file:config/environment.js',
      name: application.get('devFixtures.overlay')
    });
    possibleValues.push({
      from: 'localStorage:' + STORAGE_KEY,
      name: window.localStorage.getItem(STORAGE_KEY)
    });
    // grabbing the first one not undefined
    value = Ember.A(possibleValues).find(function (value) {
      return value !== undefined;
    });
    // saving it in the localStorage
    if (value && value.name) {
      window.localStorage.setItem(STORAGE_KEY, value.name);
    }
    else {
      window.localStorage.removeItem(STORAGE_KEY);
    }
  }
  // no overlay found anywhere
  if (!value) {
    value = {from: 'default', name: null};
  }
  return value;
}
function readOverlay ( application ) { var possibleValues , value ; if ( Ember . testing ) { // when in test mode, use the overlay specified in the application value = { from : 'test:startApp()' , name : application . get ( 'devFixtures.overlay' ) } ; } else { // else try many locations possibleValues = [ ] ; location . href . replace ( / (?:\?|&)FIXTURES_OVERLAY(?:=([^&#$]*))?(?:&|#|$) / , function ( dummy , value ) { value = value ? decodeURIComponent ( value ) : null ; possibleValues . push ( { from : 'location.search:FIXTURES_OVERLAY' , name : value } ) ; } ) ; possibleValues . push ( { from : 'file:config/environment.js' , name : application . get ( 'devFixtures.overlay' ) } ) ; possibleValues . push ( { from : 'localStorage:' + STORAGE_KEY , name : window . localStorage . getItem ( STORAGE_KEY ) } ) ; // grabbing the first one not undefined value = Ember . A ( possibleValues ) . find ( function ( value ) { return value !== undefined ; } ) ; // saving it in the localStorage if ( value && value . name ) { window . localStorage . setItem ( STORAGE_KEY , value . name ) ; } else { window . localStorage . removeItem ( STORAGE_KEY ) ; } } // no overlay found anywhere if ( ! value ) { value = { from : 'default' , name : null } ; } return value ; }
Reads and save the overlay

@function readOverlay
@param {Ember.Application} application
@return {{from: string, name: string|null}}
Reads and save the overlay