rem: etype = etype.replace(/^\s+/, ""); etype = etype.replace(/\s+$/, ""); etype = etype.replace(/\s*;.*/, ""); etype = etype.toLowerCase();  if (etype == "application/rss+xml" || etype == "application/atom+xml" || (etype == "text/xml" || etype == "application/xml" || etype == "application/rdf+xml") && rssTitleRegex.test(etitle)) { 
add: if (!isFeed) {  etype = etype.replace(/^\s+/, ""); etype = etype.replace(/\s+$/, ""); etype = etype.replace(/\s*;.*/, ""); etype = etype.toLowerCase(); isFeed = (etype == "application/rss+xml" || etype == "application/atom+xml"); }  if (!isFeed) {  isFeed = ((etype == "text/xml" || etype == "application/xml" || etype == "application/rdf+xml") && rssTitleRegex.test(etitle)); }  if (isFeed) { 
context:   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 erel = event.target.rel;    var etype = event.target.type;    var etitle = event.target.title;    const alternateRelRegex = /(^|\s)alternate($|\s)/i;    const stylesheetRelRegex = /(^|\s)stylesheet($|\s)/i;    const rssTitleRegex = /(^|\s)rss($|\s)/i;    if (!alternateRelRegex.test(erel) || stylesheetRelRegex.test(erel) ||        !etype)      return;    etype = etype.replace(/^\s+/, "");    etype = etype.replace(/\s+$/, "");    etype = etype.replace(/\s*;.*/, "");    etype = etype.toLowerCase();    if (etype == "application/rss+xml" ||        etype == "application/atom+xml" ||        (etype == "text/xml" ||         etype == "application/xml" ||         etype == "application/rdf+xml") &&        rssTitleRegex.test(etitle))    {      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;      var wrapper = event.target;      try {         urlSecurityCheck(wrapper.href, gBrowser.currentURI.spec,                         Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT_OR_DATA);      }      catch (ex) {        dump(ex.message);        return; // doesn't pass security check      }      feeds.push({ href: wrapper.href,                   type: etype,                   title: wrapper.title});      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"));        }      }    }  }
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/f9e7ca6e33b1933f653d3188e96c56c754c373f6/browser.js/clean/browser/base/content/browser.js