rem: aOffset = shortcutURL.indexOf("%s"); if (aOffset >= 0) shortcutURL = shortcutURL.substr(0, aOffset) + text + shortcutURL.substr(aOffset+2); else shortcutURL = null; 
add: shortcutURL = /%[sS]/.test(shortcutURL) ? shortcutURL.replace(/%s/g, encodeURIComponent(text)) .replace(/%S/g, text) : null; 
context: function getShortcutOrURI(url){  // rjc: added support for URL shortcuts (3/30/1999)  try {    if (!gBookmarksService)      gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"]                                    .getService(Components.interfaces.nsIBookmarksService);    var shortcutURL = gBookmarksService.resolveKeyword(url);    if (!shortcutURL) {      // rjc: add support for string substitution with shortcuts (4/4/2000)      //      (see bug # 29871 for details)      var aOffset = url.indexOf(" ");      if (aOffset > 0) {        var cmd = url.substr(0, aOffset);        var text = url.substr(aOffset+1);        shortcutURL = gBookmarksService.resolveKeyword(cmd);        if (shortcutURL && text) {          aOffset = shortcutURL.indexOf("%s");          if (aOffset >= 0)            shortcutURL = shortcutURL.substr(0, aOffset) + text + shortcutURL.substr(aOffset+2);          else            shortcutURL = null;        }      }    }    if (shortcutURL)      url = shortcutURL;  } catch (ex) {  }  return url;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/3666efba59673eb361ef2ae891ac2d98b6565903/navigator.js/buggy/xpfe/browser/resources/content/navigator.js