Use async site callback to async fetch feeds for some sites
authorEdward Lee <edilee@mozilla.com>
Sat, 14 Mar 2009 17:10:47 -0500
changeset 147 f08b980a4c66
parent 146 70b107b1c32d
child 148 d467d0d63dad
push id105
push useredward.lee@engineering.uiuc.edu
push dateSat, 14 Mar 2009 22:10:57 +0000
Use async site callback to async fetch feeds for some sites
chrome/content/browser.xul
--- a/chrome/content/browser.xul
+++ b/chrome/content/browser.xul
@@ -11,12 +11,15 @@
   }
 
   // Add in ambient news listener for new <link> elements
   Components.utils.import("resource://abouttab/ambnews.js");
   window.addEventListener("DOMLinkAdded", AmbNews.onLinkAdded, false);
 
   // Prefetch the sites we want to display and some extra
   Components.utils.import("resource://abouttab/sites.js");
-  Sites.get(20);
+  Components.utils.import("resource://abouttab/feeds.js");
+  Sites.get(20, function(sites) sites.slice(0, 10).
+    // Prefetch feeds for some of the sites
+    forEach(function(site) Feeds.get(site.id)));
   ]]>
   </script>
 </overlay>