bramski / angular-indexedDB

An angularjs serviceprovider to utilize indexedDB with angular
165 stars 49 forks source link

Feature: Safari 8 Support #15

Closed motorox closed 8 years ago

motorox commented 9 years ago

Hello,

have you tested it on Safari? I'm running an app successfully on Chrome and FF on Mac, but Safari is not ok, but not giving any error.

Thanks, Mitch

bramski commented 9 years ago

http://caniuse.com/#feat=indexeddb

bramski commented 9 years ago

I do not think safari has indexed db support at this time.

motorox commented 9 years ago

Hi, i debugged the code (JS) a little and at line 126 you should put: dbReq.onupgradeneeded = function(event) { var tx,oldVersion; oldVersion = event.oldVersion; if(oldVersion > 99999999999){ oldVersion = 0; } db = event.target.result; tx = event.target.transaction; console.debug("$indexedDB: Upgrading database '" + db.name + "' from version " + oldVersion + " to version " + event.newVersion + " ..."); applyNeededUpgrades(oldVersion, event, db, tx); }; It's an issue on Safari with the version of the DB first time.

motorox commented 9 years ago

Also for the eachBy to work, keyRangeForOptions should return null if no begin/end keys: keyRangeForOptions = function(options) { if (options.beginKey && options.endKey) { return IDBKeyRange.bound(options.beginKey, options.endKey); } return null; };

bramski commented 9 years ago

Open a pull request. My uses are currently 100% chrome and this is really low priority for me to make work. If you make a PR with the fixes you desire and it passes I am pretty certain I will merge it.