feeds.push(feed); browserForLink.feeds = feeds; if (browserForLink == gBrowser || browserForLink == gBrowser.mCurrentBrowser) { var feedButton = document.getElementById("feed-button"); if (feedButton) { feedButton.setAttribute("feeds", "true"); feedButton.setAttribute("tooltiptext", gNavigatorBundle.getString("feedHasFeedsNew")); } 
var targetDoc = link.ownerDocument; var ios = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService); var uri = ios.newURI(link.href, targetDoc.characterSet, null); try {    const aboutNeterr = "about:neterror?"; if (targetDoc.documentURI.substr(0, aboutNeterr.length) != aboutNeterr || !uri.schemeIs("chrome")) { var ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]. getService(Ci.nsIScriptSecurityManager); ssm.checkLoadURIWithPrincipal(targetDoc.nodePrincipal, uri, Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT); } } catch(e) { break; }   if (contentPolicy.shouldLoad(Ci.nsIContentPolicy.TYPE_IMAGE, uri, targetDoc.documentURIObject, link, link.type, null) != Ci.nsIContentPolicy.ACCEPT) break;  var browserIndex = gBrowser.getBrowserIndexForDocument(targetDoc);  if (browserIndex == -1) break;  var tab = gBrowser.mTabContainer.childNodes[browserIndex]; gBrowser.setIcon(tab, link.href); iconAdded = true; } break; case "search": if (!searchAdded) { var type = link.type && link.type.toLowerCase(); type = type.replace(/^\s+|\s*(?:;.*)?$/g, "");  if (type == "application/opensearchdescription+xml" && link.title && /^(https?|ftp):/i.test(link.href)) { var engine = { title: link.title, href: link.href }; BrowserSearch.addEngine(engine, link.ownerDocument); searchAdded = true; } } break; 
  onLinkAdded: function(event) {    // XXX this event listener can/should probably be combined with the onLinkAdded    // listener in tabbrowser.xml, which only listens for favicons and then passes    // them to onLinkIconAvailable in the ProgressListener.  We could extend the    // progress listener to have a generic onLinkAvailable and have tabbrowser pass    // along all events.  It should give us the browser for the tab, as well as    // the actual event.    var feed = recognizeFeedFromLink(event.target,      event.target.ownerDocument.nodePrincipal);    if (feed) {      const targetDoc = event.target.ownerDocument;      // find which tab this is for, and set the attribute on the browser      var browserForLink = gBrowser.getBrowserForDocument(targetDoc);      if (!browserForLink) {        // ??? this really shouldn't happen..        return;      }      var feeds = [];      if (browserForLink.feeds != null)        feeds = browserForLink.feeds;      feeds.push(feed);      browserForLink.feeds = feeds;      if (browserForLink == gBrowser || browserForLink == gBrowser.mCurrentBrowser) {        var feedButton = document.getElementById("feed-button");        if (feedButton) {          feedButton.setAttribute("feeds", "true");          feedButton.setAttribute("tooltiptext",                                   gNavigatorBundle.getString("feedHasFeedsNew"));        }      }    }  }
5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5459/9ace39b43462e370345a8b9260a36f3fecc92061/browser.js/buggy/browser/base/content/browser.js