Q:

Test for successful firebase connection

var fb = new Firebase("https://badspelling.firebaseio.com/")
Will generate the following warring in the console: 

FIREBASE WARNING: Firebase error. Please ensure that you spelled the name of your Firebase correctly (https://badspelling.firebaseio.com)

How can I pragmatically test for a valid connection? 
fb.validConnection(); //error 
Reason: I'm redoing the Getting Started page to set up Firefight js examples once the users enter a valid firebase app url.

A:

I’m going to monkey patch console.warn.  
var orgWarn = console.warn;                
console.warn = function(message) {                    
  if(-1 !== message.indexOf("FIREBASE WARNING: Firebase error. Please ensure that you spelled")) {
    error(message);                        
  } 
  return orgWarn.apply(console, arguments);
};
try {
  var firebase = new Firebase(url);                        
  firebase.once("value", enterUrl); 
  function enterUrl(snap) {
    setUpButtons(database);                        
  };
}
catch (e) {
  error(e.message);
}; 

Thanks for your help, but testing for connectivity causes a trimming issue.  My goal is to display buttons on a valid url and an error on an invalid url.    A valid url may not be connected yet (false negative).  I would have to wait before I can test an invalid url.  Boo
https://www.firebase.com/docs/web/guide/offline-capabilities.html#section-connection-state

