rem: var history = Components.classes['component: if (history) { history = history.getService(); } if (history) { history = history.QueryInterface(Components.interfaces.nsIGlobalHistory); } if (history) { startpage = history.GetLastPageVisted(); } break; 
add: try { var history = Components.classes["component: history = history.QueryInterface(Components.interfaces.nsIGlobalHistory); startpage = history.GetLastPageVisted(); } catch (ex) { dump(ex +"\n"); } break; 
context:   function OpenBrowserWindow()  {            pref = Components.classes['component://netscape/preferences'];                // if all else fails, use trusty "about:blank" as the start page            var startpage = "about:blank";              if (pref) {              pref = pref.getService();               pref = pref.QueryInterface(Components.interfaces.nsIPref);            }	                                  if (pref) {              // from mozilla/modules/libpref/src/init/all.js              // 0 = blank               // 1 = home (browser.startup.homepage)              // 2 = last 			choice = 1;			try {              		choice = pref.GetIntPref("browser.startup.page");			}			catch (ex) {				dump("failed to get the browser.startup.page pref\n");			}		    	  switch (choice) {    		case 0:                		startpage = "about:blank";          			break;    		case 1:				try {                			startpage = pref.CopyCharPref("browser.startup.homepage");				}				catch (ex) {					dump("failed to get the browser.startup.homepage pref\n");					startpage = "about:blank";				}          			break;    		case 2:                		var history = Components.classes['component://netscape/browser/global-history'];    			if (history) {                   			history = history.getService();    	    		}    	    		if (history) {                  			history = history.QueryInterface(Components.interfaces.nsIGlobalHistory);    	    		}    	    		if (history) {    				startpage = history.GetLastPageVisted();    	    		}          			break;       		default:                		startpage = "about:blank";    	  }  	}  	window.open(startpage);  }
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/0d1ef6d630737ac836728c41d7228bebcdb6f1a4/tasksOverlay.js/clean/xpfe/global/resources/content/tasksOverlay.js