1. safari-14-idb-fix
Working around a Safari 14 IndexedDB bug
safari-14-idb-fix
Package: safari-14-idb-fix
Last modified: Mon, 16 May 2022 10:08:56 GMT
Version: 3.0.0
License: Apache-2.0
Downloads: 551,687

Install

npm install safari-14-idb-fix
yarn add safari-14-idb-fix

Safari 14 IndexedDB fix

Safari on macOS Big Sur 11.4 and iOS 14.6 has a nasty bug where IndexedDB requests get lost and never resolve. The issue was fixed in Safari 14.7.

This library (well, function) works around the issue and tells you when IndexedDB is actually available.

To install:

npm i safari-14-idb-fix

To use:

 import idbReady from 'safari-14-idb-fix';

idbReady().then(() => {
  // Safari has definitely figured out where IndexedDB is.
  // You can use IndexedDB as usual.
});

All bundles

A modern build tool will handle the above example fine, but if you need a specific build:

  • safari-14-idb-fix/dist/index.js EcmaScript module.
  • safari-14-idb-fix/dist/index.cjs CommonJS module.
  • safari-14-idb-fix/dist/iife.min.js Minified plain JS, which creates an idbReady global.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code