add: gIOService = Components.classes["@mozilla.org/network/io-service;1"] .getService(nsIIOService); gPrompt        = document.getElementById("autoDownload"); gLocation      = document.getElementById("downloadLocation"); gChooseButton  = document.getElementById("chooseDownloadFolder"); gFolderField   = document.getElementById("downloadFolder"); gFinishedSound = document.getElementById("finishedSoundUrl");  var prefWindow = parent.hPrefWindow; gChooseButtonLocked  = prefWindow.getPrefIsLocked(kDownloadDirPref); gPromptLocked        = prefWindow.getPrefIsLocked("browser.download.autoDownload"); gFinishedSoundLocked = prefWindow.getPrefIsLocked("browser.download.finished_sound_url");  var dir = prefWindow.getPref("localfile", kDownloadDirPref); if (dir == "!/!ERROR_UNDEFINED_PREF!/!") dir = null;  if (!dir) { try {  var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"] .getService(nsIProperties); dir = dirSvc.get("ProfD", nsILocalFile);   prefWindow.setPref("localfile", kDownloadDirPref, dir); } catch (ex) { } }   if (dir) gFolderField.value = (/Mac/.test(navigator.platform)) ? dir.leafName : dir.path;  setPrefDLElements();   try { var URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"] .getService(nsIURIFixup); gFinishedSound.value = URIFixup.createFixupURI(gFinishedSound.value, nsIURIFixup.FIXUP_FLAG_NONE).spec; } catch (ex) { }  
context: function Startup(){  PlaySoundCheck();  // if we don't have the alert service, hide the pref UI for using alerts to notify on download completion  // see bug #158711  var downloadDoneNotificationAlertUI = document.getElementById("finishedNotificationAlert");  downloadDoneNotificationAlertUI.hidden = !("@mozilla.org/alerts-service;1" in Components.classes);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/c8ccded27b2754a86d9bbb5740b0c4328b388363/pref-download.js/clean/suite/common/pref/pref-download.js