WebKit Bugzilla
Attachment 371806 Details for
Bug 198738
: REGRESSION (r244436): IndexedDB Uint8Array returned as ArrayBuffer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Example script to reproduce
idb.html (text/html), 971 bytes, created by
E.J. Daly
on 2019-06-10 19:03:32 PDT
(
hide
)
Description:
Example script to reproduce
Filename:
MIME Type:
Creator:
E.J. Daly
Created:
2019-06-10 19:03:32 PDT
Size:
971 bytes
patch
obsolete
><html> > <script> > var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB; > var open = indexedDB.open("TestBinaryData", 1); > open.onupgradeneeded = function() { > var db = open.result; > var store = db.createObjectStore("ObjectStore", {keyPath: "id"}); > }; > open.onsuccess = function() { > var db = open.result; > var tx = db.transaction("ObjectStore", "readwrite"); > var store = tx.objectStore("ObjectStore"); > > let id = new Uint8Array([1,2,3,4]); > let data = new Uint8Array([1,2,3,4,5,6,7,8]) > let input = { id, data }; > console.log({ input }) > store.put(input); > var req = store.get(id); > > req.onsuccess = function() { > let output = req.result; > console.log({ output }); > }; > > tx.oncomplete = function() { > db.close(); > }; > } > </script> ></html>
<html> <script> var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB; var open = indexedDB.open("TestBinaryData", 1); open.onupgradeneeded = function() { var db = open.result; var store = db.createObjectStore("ObjectStore", {keyPath: "id"}); }; open.onsuccess = function() { var db = open.result; var tx = db.transaction("ObjectStore", "readwrite"); var store = tx.objectStore("ObjectStore"); let id = new Uint8Array([1,2,3,4]); let data = new Uint8Array([1,2,3,4,5,6,7,8]) let input = { id, data }; console.log({ input }) store.put(input); var req = store.get(id); req.onsuccess = function() { let output = req.result; console.log({ output }); }; tx.oncomplete = function() { db.close(); }; } </script> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 198738
:
371805
| 371806 |
372785
|
372792
|
372796
|
372798
|
372800
|
372803