vifito.eu

Web Development & Open Source

  • Aumentar o tamaño da fonte
  • Tamaño do texto por defecto
  • Diminuir o tamaño do texto

Eliminar a cabeceira de autenticación HTTP

Código javascript para limpar a cabeceira coa autenticación HTTP.

function clear_http_authentication() {
 try {
  if (document.all) {
   // IE 6 clear HTTP Authentication
   document.execCommand("ClearAuthenticationCache");
  } else {
   netscape.security.PrivilegeManager.
     enablePrivilege("UniversalXPConnect");
   authenticationManager = Components.classes
     ["@mozilla.org/network/http-auth-manager;1"].
     getService(Components.interfaces.nsIHttpAuthManager);
   authenticationManager.clearAll();
  }
 } catch(e) { 
  /* Agochar erros */ 
 }
}