B2G/gecko/toolkit/content/tests/chrome/RegisterUnregisterChrome.js
// the registrarion when no longer needed.
the registrarion when no longer needed.
the registrarion when no longer needed .
function registerManifestTemporarily(manifestURI)
{
  gPrefs.setBoolPref(XUL_CACHE_PREF, true);
  let file = chromeURIToFile(manifestURI);
  let tempfile = copyToTemporaryFile(file);
  Components.manager.QueryInterface(Ci.nsIComponentRegistrar).
    autoRegister(tempfile);
  gChromeReg.refreshSkins();
  return function() {
    tempfile.fileSize = 0; 
    gChromeReg.checkForNewChrome();
    gChromeReg.refreshSkins();
    gPrefs.clearUserPref(XUL_CACHE_PREF);
  }
}
function registerManifestTemporarily ( manifestURI ) { gPrefs . setBoolPref ( XUL_CACHE_PREF , true ) ; let file = chromeURIToFile ( manifestURI ) ; let tempfile = copyToTemporaryFile ( file ) ; Components . manager . QueryInterface ( Ci . nsIComponentRegistrar ) . autoRegister ( tempfile ) ; gChromeReg . refreshSkins ( ) ; return function ( ) { tempfile . fileSize = 0 ; gChromeReg . checkForNewChrome ( ) ; gChromeReg . refreshSkins ( ) ; gPrefs . clearUserPref ( XUL_CACHE_PREF ) ; } }
the registrarion when no longer needed.
the registrarion when no longer needed .
// truncate the manifest