add: if (f.isExecutable()) { var dontAsk = false; var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { dontAsk = !pref.getBoolPref(PREF_BDM_ALERTONEXEOPEN); } catch (e) { }  if (!dontAsk) { var strings = document.getElementById("downloadStrings"); var name = aEvent.target.getAttribute("target"); var message = strings.getFormattedString("fileExecutableSecurityWarning", [name, name]);  var title = strings.getString("fileExecutableSecurityWarningTitle"); var dontAsk = strings.getString("fileExecutableSecurityWarningDontAsk");  var promptSvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var checkbox = { value: false }; var open = promptSvc.confirmCheck(window, title, message, dontAsk, checkbox);  if (!open) return; else pref.setBoolPref(PREF_BDM_ALERTONEXEOPEN, !checkbox.value); } } 
context: function onDownloadOpen(aEvent){  var download = aEvent.target;  if (download.localName == "download") {    if (download.openable) {      var f = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);      f.initWithPath(aEvent.target.id);      if (f.exists()) {        // XXXben security check!          f.launch();      }      else {        var brandStrings = document.getElementById("brandStrings");        var appName = brandStrings.getString("brandShortName");              var strings = document.getElementById("downloadStrings");        var name = aEvent.target.getAttribute("target");        var message = strings.getFormattedString("fileDoesNotExistOpenError", [name, appName]);        var title = strings.getFormattedString("fileDoesNotExistOpenTitle", [name]);        var promptSvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);        promptSvc.alert(window, title, message);      }    }    else if(download.canceledOrFailed) {      // If the user canceled this download, double clicking tries again.       fireEventForElement(download, "retry")    }  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/ef93ef1bd59de883f79ce58590c79b2c776dfc2c/downloads.js/buggy/toolkit/mozapps/downloads/content/downloads.js