rem: var appShellService = Components.classes[APPSHELL_SERV_PROGID].getService(nsIAppShellService); parent = appShellService.GetHiddenWindow(); 
add: try { var appShellService = Components.classes[APPSHELL_SERV_PROGID].getService(nsIAppShellService); parent = appShellService.getHiddenDOMWindow(); } catch(ex) { dump("Can't get parent.  xpconnect hates me so we can't get one from the appShellService.\n"); dump(ex + "\n"); } 
context:   show: function() {    var o = new Object();    o.title = this.mTitle;    o.mode = this.mMode;    o.displayDirectory = this.mDisplayDirectory;    o.defaultString = this.mDefaultString;    o.filters = new Object();    o.filters.titles = this.mFilterTitles;    o.filters.types = this.mFilters;    o.retvals = new Object();    var parent;    try {      if (this.mParentWindow) {        parent = this.mParentWindow;      } else if (window) {        parent = window;      } else {        var appShellService = Components.classes[APPSHELL_SERV_PROGID].getService(nsIAppShellService);        parent = appShellService.GetHiddenWindow();      }    } catch(ex) { }    parent.openDialog("chrome://global/content/filepicker.xul",                      "",                      "chrome,modal,resizeable=yes,dependent=yes",                      o);    this.mFile = o.retvals.file;    lastDirectory = o.retvals.directory;    return o.retvals.buttonStatus;  }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/c165e6c65b89e212db918fabb409c6b4202ed9dd/nsFilePicker.js/buggy/xpfe/components/filepicker/src/nsFilePicker.js