rem: var text = document.getElementById('urlbar').value; var shortcutURL = bmks.FindShortcut(text); if ((shortcutURL == null) || (shortcutURL == "")) {   var aOffset = text.indexOf(" "); if (aOffset > 0) { var cmd = text.substr(0, aOffset); text = text.substr(aOffset+1); shortcutURL = bmks.FindShortcut(cmd); if ((shortcutURL) && (shortcutURL != "") && (text != "")) { aOffset = shortcutURL.indexOf("%s"); if (aOffset >= 0) { shortcutURL = shortcutURL.substr(0, aOffset) + text + shortcutURL.substr(aOffset+2); } else { shortcutURL = null; } } } } if ((shortcutURL != null) && (shortcutURL != "")) { document.getElementById('urlbar').value = shortcutURL; 
add:  try { var bmks = Components.classes["@mozilla.org/browser/bookmarks-service;1"] .getService(Components.interfaces.nsIBookmarksService);  var shortcutURL = bmks.FindShortcut(url); if (!shortcutURL) {   var aOffset = url.indexOf(" "); if (aOffset > 0) { var cmd = url.substr(0, aOffset); var text = url.substr(aOffset+1); shortcutURL = bmks.FindShortcut(cmd); if (shortcutURL && text) { aOffset = shortcutURL.indexOf("%s"); if (aOffset >= 0) shortcutURL = shortcutURL.substr(0, aOffset) + text + shortcutURL.substr(aOffset+2); else shortcutURL = null; } 
context:   function BrowserLoadURL()  {    // rjc: added support for URL shortcuts (3/30/1999)    try    {      var bmks = Components.classes["@mozilla.org/browser/bookmarks-service;1"]                           .getService(Components.interfaces.nsIBookmarksService);      var text = document.getElementById('urlbar').value;      var shortcutURL = bmks.FindShortcut(text);      if ((shortcutURL == null) || (shortcutURL == ""))      {        // rjc: add support for string substitution with shortcuts (4/4/2000)        //      (see bug # 29871 for details)      	var aOffset = text.indexOf(" ");      	if (aOffset > 0)      	{      	  var cmd = text.substr(0, aOffset);      	  text = text.substr(aOffset+1);          shortcutURL = bmks.FindShortcut(cmd);          if ((shortcutURL) && (shortcutURL != "") && (text != ""))          {            aOffset = shortcutURL.indexOf("%s");            if (aOffset >= 0)            {              shortcutURL = shortcutURL.substr(0, aOffset) + text + shortcutURL.substr(aOffset+2);            }            else            {              shortcutURL = null;            }          }      	        	}      }      if ((shortcutURL != null) && (shortcutURL != ""))      {        document.getElementById('urlbar').value = shortcutURL;      }    }    catch (ex)    {      // stifle any exceptions so we're sure to load the URL.    }    loadURI(gURLBar.value);    _content.focus();  }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/cd80143aee6dbfef87e3bdbb3948780e5f478fca/navigator.js/buggy/suite/browser/navigator.js