rem: var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"] .getService(Components.interfaces.nsIShellService); var brandBundle = document.getElementById("bundleBrand"); var shellBundle = document.getElementById("bundleShell"); var brandShortName = brandBundle.getString("brandShortName"); var promptTitle = shellBundle.getString("setDefaultBrowserTitle"); var promptMessage; const IPS = Components.interfaces.nsIPromptService; var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(IPS); if (!shellSvc.isDefaultBrowser(false)) { promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage", [brandShortName]); var rv = psvc.confirmEx(window, promptTitle, promptMessage, (IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) + (IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1), null, null, null, null, { }); if (rv == 0) shellSvc.setDefaultBrowser(true, false); } else { promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser", [brandShortName]); psvc.alert(window, promptTitle, promptMessage); } 
add: var browserGlue = Components.classes["@mozilla.org/browser/browserglue;1"] .getService(Components.interfaces.nsIBrowserGlue); browserGlue.checkDefaultBrowser(true, window); 
context:   checkNow: function ()  {    var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"]                             .getService(Components.interfaces.nsIShellService);    var brandBundle = document.getElementById("bundleBrand");    var shellBundle = document.getElementById("bundleShell");    var brandShortName = brandBundle.getString("brandShortName");    var promptTitle = shellBundle.getString("setDefaultBrowserTitle");    var promptMessage;    const IPS = Components.interfaces.nsIPromptService;    var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]                         .getService(IPS);    if (!shellSvc.isDefaultBrowser(false)) {      promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",                                                      [brandShortName]);      var rv = psvc.confirmEx(window, promptTitle, promptMessage,                               (IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) +                               (IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1),                              null, null, null, null, { });      if (rv == 0)        shellSvc.setDefaultBrowser(true, false);    }    else {      promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",                                                     [brandShortName]);      psvc.alert(window, promptTitle, promptMessage);    }  }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/f6a754649068adb450b7ca660c40c58eadc94c9e/general.js/clean/browser/components/preferences/general.js