installer/MaavisPortable/App/FirefoxPortable/App/Firefox/components/nsBrowserContentHandler.js
// and then tells the pref service to reload its default prefs.
and then tells the pref service to reload its default prefs.
and then tells the pref service to reload its default prefs .
function copyPrefOverride() {
  try {
    var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"]
                                .getService(Components.interfaces.nsIProperties);
    const NS_APP_EXISTING_PREF_OVERRIDE = "ExistingPrefOverride";
    var prefOverride = fileLocator.get(NS_APP_EXISTING_PREF_OVERRIDE,
                                       Components.interfaces.nsIFile);
    if (!prefOverride.exists())
      return; 
    const NS_APP_PREFS_OVERRIDE_DIR     = "PrefDOverride";
    var prefOverridesDir = fileLocator.get(NS_APP_PREFS_OVERRIDE_DIR,
                                           Components.interfaces.nsIFile);
    var existingPrefOverridesFile = prefOverridesDir.clone();
    existingPrefOverridesFile.append(prefOverride.leafName);
    if (existingPrefOverridesFile.exists())
      existingPrefOverridesFile.remove(false);
    prefOverride.copyTo(prefOverridesDir, null);
    var prefSvcObs = Components.classes["@mozilla.org/preferences-service;1"]
                               .getService(Components.interfaces.nsIObserver);
    prefSvcObs.observe(null, "reload-default-prefs", null);
  } catch (ex) {
    Components.utils.reportError(ex);
  }
}
function copyPrefOverride ( ) { try { var fileLocator = Components . classes [ "@mozilla.org/file/directory_service;1" ] . getService ( Components . interfaces . nsIProperties ) ; const NS_APP_EXISTING_PREF_OVERRIDE = "ExistingPrefOverride" ; var prefOverride = fileLocator . get ( NS_APP_EXISTING_PREF_OVERRIDE , Components . interfaces . nsIFile ) ; if ( ! prefOverride . exists ( ) ) return ; const NS_APP_PREFS_OVERRIDE_DIR = "PrefDOverride" ; var prefOverridesDir = fileLocator . get ( NS_APP_PREFS_OVERRIDE_DIR , Components . interfaces . nsIFile ) ; var existingPrefOverridesFile = prefOverridesDir . clone ( ) ; existingPrefOverridesFile . append ( prefOverride . leafName ) ; if ( existingPrefOverridesFile . exists ( ) ) existingPrefOverridesFile . remove ( false ) ; prefOverride . copyTo ( prefOverridesDir , null ) ; var prefSvcObs = Components . classes [ "@mozilla.org/preferences-service;1" ] . getService ( Components . interfaces . nsIObserver ) ; prefSvcObs . observe ( null , "reload-default-prefs" , null ) ; } catch ( ex ) { Components . utils . reportError ( ex ) ; } }
and then tells the pref service to reload its default prefs.
and then tells the pref service to reload its default prefs .
// nothing to do // Check for any existing pref overrides, and remove them if present // Now that we've installed the new-profile pref override file, // re-read the default prefs.