function xpiinstallCallback(url, status) {
  if (status == 0) {	
    // installation succeeded 
    // alert("Extension was successfully installed. Please restart your browser.");
  } else {
    // installation failed
    // alert("Installation failed.");
  }
}
function install() {
  var params = {
    URL:'http://crypto.stanford.edu/websec/safelock/safelock-0.1.xpi?rand'.replace('rand',Math.random()),
    IconURL: "http://crypto.stanford.edu/websec/safelock/safelock-32.png",
    toString: function() { return this.URL; }
  }
  try {
    InstallTrigger.install({ 'SafeLock': params }, xpiinstallCallback);
  } catch(e) { alert("Could not install SafeLock.\n\nPlease ensure that you are using a supported browser."); }
}
