utils.js
/**
 * Reads the app settings from `globalThis.remoteSettings.userDataPath` on the
 * system and stores it global in `globalThis.appSettings`.  Also validates the
 * app settings before saving them.
 * @returns {SFE_AppSettings}
 */
Reads the app settings from `globalThis.remoteSettings.userDataPath` on the
system and stores it global in `globalThis.appSettings`.  Also validates the
app settings before saving them.
Reads the app settings from ` globalThis . remoteSettings . userDataPath ` on the system and stores it global in ` globalThis . appSettings ` . Also validates the app settings before saving them .
function loadAppSettings() {
  const remoteSettings = globalThis.remoteSettings;
  const settingsFilePath = path.join(remoteSettings.userDataPath, 'settings.json');
  let appSettings = fs.existsSync(settingsFilePath)
    ? JSON.parse(fs.readFileSync(settingsFilePath, {encoding: 'utf-8'}))
    : {};
  globalThis.appSettings = validateAppSettings(appSettings);
  return saveAppSettings();
}
function loadAppSettings ( ) { const remoteSettings = globalThis . remoteSettings ; const settingsFilePath = path . join ( remoteSettings . userDataPath , 'settings.json' ) ; let appSettings = fs . existsSync ( settingsFilePath ) ? JSON . parse ( fs . readFileSync ( settingsFilePath , { encoding : 'utf-8' } ) ) : { } ; globalThis . appSettings = validateAppSettings ( appSettings ) ; return saveAppSettings ( ) ; }
Reads the app settings from `globalThis.remoteSettings.userDataPath` on the
 system and stores it global in `globalThis.appSettings`.
Reads the app settings from ` globalThis . remoteSettings . userDataPath ` on the system and stores it global in ` globalThis . appSettings ` .
/** @type {import('./background').SFE_RemoteSettings} */ /** @type {SFE_AppSettings} */