Recently in learning Indexdb, using the Idbobjectstore.getall, found on the phone is not supported.
Later, the MDN was consulted:
?
Indeed, it is not supported and you can see that this function is now poorly compatible.
Workaround:
1. Use Idbobjectstore.opencursor (better compatibility) instead,
2. Simulate one yourself to be compatible:
if (typeof IDBObjectStore.prototype.getAll! = ' function ') {IDBObjectStore.prototype.getAll = function (params) {var Request = {};var req = this.opencursor (params); req.onerror = function (evt) {if (typeof request.onerror = = ' function ') {req Uest.onerror (EVT);}}; var rst_values = [];req.onsuccess = function (evt) {if (typeof request.onsuccess = = ' function ') {var cursor = Event.target. Result;if (cursor) {Rst_values.push (cursor.value); Cursor.continue ();} else {request.result = rst_values; Evt.target.result = rst_values;request.onsuccess (EVT);}}} return request;}}
Mobile browser does not support Idbobjectstore.getall