Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Testing Safari issue with IDBObjectStore.getAll()</title>
- </head>
- <body>
- <h1>Testing Safari issue with IDBObjectStore.getAll()</h1>
- <p>Status: <span id="statusText"></span></p>
- <p>navigator.userAgent: <span id="uaText"></span></p>
- <p>navigator.vendor: <span id="vendorText"></span></p>
- <p>navigator.appVersion: <span id="appVersionText"></span></p>
- <script src="dexie.js"></script>
- <script type="text/javascript">
- var db = new Dexie('testdb');
- db.version(1).stores({
- items: 'id',
- });
- db.open().then(()=>{
- console.log("Could open. Now putting an item into DB");
- return db.items.put({id: 1, name: "foo"});
- }).then(()=> {
- console.log("Could put item. Now trying IDBObjectStore.getAll()");
- return db.items.toArray();
- }).then(()=>{
- console.log("Successfully called IDBObjectStore.getAll()");
- }).catch(err => {
- console.log("Fail calling IDBObjectStore.getAll() from a worker. Error: " + err);
- });
- document.getElementById('uaText').innerText = navigator.userAgent;
- document.getElementById('vendorText').innerText = navigator.vendor;
- document.getElementById('appVersionText').innerText = navigator.appVersion;
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment