rem: appCore.loadInitialPage(); } else {  dump("Scheduling later attempt to set content window\n"); window.setTimeout( "tryToSetContentWindow()", 100 ); 
add: 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) { startpage = startPageDefault; } break; case 2: var history = getService( "component: if (history) startpage = history.GetLastPageVisted(); break; default: startpage = startPageDefault; } } else dump("Failed to retrieve pref service\n"); var args = document.getElementById("args") if (args) args.setAttribute("value", startpage); 
context:   function tryToSetContentWindow() {    var startpage = startPageDefault;    if ( window.content ) {        dump("Setting content window\n");        appCore.setContentWindow( window.content );        // Have browser app core load appropriate initial page.        if ( !explicitURL ) {            // if all else fails, use trusty "about:blank" as the start page            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");		}		dump("browser.startup.page = " + choice + "\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 homepage!\n");					startpage = startPageDefault;				}          			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 = startPageDefault;    	  }            }            else {		dump("failed to QI pref service\n");	    }	    dump("startpage = " + startpage + "\n");          var args = document.getElementById("args")            if (args) args.setAttribute("value", startpage);        }        appCore.loadInitialPage();    } else {        // Try again.        dump("Scheduling later attempt to set content window\n");        window.setTimeout( "tryToSetContentWindow()", 100 );    }  }
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/d46106418588bec5ed4354933e11d332b81439bb/navigator.js/buggy/suite/browser/navigator.js