Index: fb.js
===================================================================
--- fb.js	(revision 3081)
+++ fb.js	(working copy)
@@ -1,16 +1,8 @@

 // This function called by facebook's javascript when it is loaded.
 window.fbAsyncInit = function() {
-  //debugger; // debug
-  // @TODO - make these settings completely customizable.
-  var settings = {xfbml: true};
-  if (Drupal.settings.fb.apikey) {
-    settings.apiKey = Drupal.settings.fb.apikey;
-    settings.status = true;
-    settings.cookie = true;
-  }

-  FB.init(settings);
+  FB.init(Drupal.settings.fb.fb_init_settings);

   // Async function to complete init.
   FB.getLoginStatus(function(response) {
@@ -104,7 +96,7 @@
   if(Drupal.settings.fb.reload_url_fragment) {
     destination = destination + "#" + Drupal.settings.fb.reload_url_fragment;
   }
-
+
   window.top.location = destination;
 };

Index: fb.module
===================================================================
--- fb.module	(revision 3083)
+++ fb.module	(working copy)
@@ -204,6 +204,23 @@
     }
   }

+  // Data structure to pass to FB.init();
+  $fb_init_settings = array(
+    'xfbml' => TRUE,
+    'status' => TRUE,
+    'cookie' => TRUE,
+    'apikey' => $_fb_app->apikey,
+  );
+  if ($channel = variable_get('fb_js_channel', TRUE)) {
+    if (!is_string($channel)) {
+      $channel = url('fb/channel', array('absolute' => TRUE, 'fb_url_alter' => FALSE));
+    }
+    $fb_init_settings['channel'] = $channel;
+  }
+
+  fb_js_settings('fb_init_settings', $fb_init_settings);
+
+
   // Allow third-parties to act, even if we did not initialize $_fb.
   fb_invoke(FB_OP_POST_INIT, array('fb_app' => $_fb_app,
                                    'fb' => $_fb));
@@ -781,7 +798,7 @@

 //// Menu structure.
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function fb_menu() {
   $items = array();
@@ -851,6 +868,13 @@
     'page arguments' => array(FB_PATH_AJAX_EVENT_ARGS),
   );

+  // "Channel" http://developers.facebook.com/docs/reference/javascript/FB.init
+  $items['fb/channel'] = array(
+    'page callback' => 'fb_channel_page',
+    'type' => MENU_CALLBACK,
+    'access callback' => TRUE,
+  );
+
   return $items;
 }

@@ -1210,3 +1234,22 @@
   drupal_access_denied();
   exit();
 }
+
+/**
+ * Menu callback for custom channel.
+ *
+ * @see http://developers.facebook.com/docs/reference/javascript/FB.init
+ */
+function fb_channel_page() {
+  //headers instructing browser to cache this page.
+  // Do these work?
+  drupal_set_header("Cache-Control: public");
+  drupal_set_header("Expires: Sun, 17-Jan-2038 19:14:07 GMT");
+
+  $date = format_date(time());
+  $output = "<!-- modules/fb fb_channel_page() $date -->\n";
+  $url = fb_js_settings('js_sdk_url');
+  $output .= "<script src=\"$url\"></script>\n";
+  print $output;
+  exit();
+}
\ No newline at end of file
