function initIDB() {
  var v = 3;
  var ranVersionChangeTransaction = false;
  var request = indexedDB.open('isolation', v);
  request.onupgradeneeded = function(e) {
    isolation.db = e.target.result;
    var store = isolation.db.createObjectStore(
        'partitions', {keyPath: "id"});
    e.target.transaction.oncomplete = function() {
      ranVersionChangeTransaction = true;
    };
  }
  request.onsuccess = function(e) {
    isolation.db = e.target.result;
    if (ranVersionChangeTransaction) {
      sendResponse('idb created');
    } else {
      sendResponse('idb open');
    }
  };
  request.onerror = isolation.onerror;
  request.onblocked = isolation.onerror;
}
// which operation has been performed - open vs create.
which operation has been performed - open vs create.
which operation has been performed - open vs create .
function initIDB() {
  var v = 3;
  var ranVersionChangeTransaction = false;
  var request = indexedDB.open('isolation', v);
  request.onupgradeneeded = function(e) {
    isolation.db = e.target.result;
    var store = isolation.db.createObjectStore(
        'partitions', {keyPath: "id"});
    e.target.transaction.oncomplete = function() {
      ranVersionChangeTransaction = true;
    };
  }
  request.onsuccess = function(e) {
    isolation.db = e.target.result;
    if (ranVersionChangeTransaction) {
      sendResponse('idb created');
    } else {
      sendResponse('idb open');
    }
  };
  request.onerror = isolation.onerror;
  request.onblocked = isolation.onerror;
}
function initIDB ( ) { var v = 3 ; var ranVersionChangeTransaction = false ; var request = indexedDB . open ( 'isolation' , v ) ; request . onupgradeneeded = function ( e ) { isolation . db = e . target . result ; var store = isolation . db . createObjectStore ( 'partitions' , { keyPath : "id" } ) ; e . target . transaction . oncomplete = function ( ) { ranVersionChangeTransaction = true ; } ; } request . onsuccess = function ( e ) { isolation . db = e . target . result ; if ( ranVersionChangeTransaction ) { sendResponse ( 'idb created' ) ; } else { sendResponse ( 'idb open' ) ; } } ; request . onerror = isolation . onerror ; request . onblocked = isolation . onerror ; }
which operation has been performed - open vs create.
which operation has been performed - open vs create .