if(this._dbOpen && (!dbName || dbName == this.dbName)){ return; } if(!this.dbName){ this.dbName = "dot_store_" + window.location.href.replace(/[^0-9A-Za-z_]/g|>, "_"); // database names in Gears are limited to 64 characters long if(this.dbName.length > 63){ this.dbName = this.dbName.substring(0, 63); } } if(!dbName){ dbName = this.dbName; } try{ this._initDb(); this.db.open(dbName); this._dbOpen = true; }catch(exp){ throw exp.message||exp; }