Skip to content

Instantly share code, notes, and snippets.

@axemclion
axemclion / IndexedDB.setVersionShim.js
Created May 11, 2012 00:29
Shim that converts Chrome's SetVersion to the standard IndexedDB onupgradeneeded events
////////////////////////////////////////////////////////////////////////////////////////////////////
var openReqShim = function(dbName, version){
var me = this;
var IDBRequest = function(){
this.onsuccess = this.onerror = this.onblocked = this.onupgradeneeded = null;
};
function copyReq(req){
req = req || dbOpenReq;