Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
safari-14-idb-fix
Advanced tools
The safari-14-idb-fix npm package provides a workaround for a known issue in Safari 14 where IndexedDB operations can fail due to a bug in the browser. This package ensures that IndexedDB operations work reliably in Safari 14 by applying necessary fixes.
Apply Fix for Safari 14 IndexedDB Bug
This feature applies the necessary fix to ensure that IndexedDB operations do not fail in Safari 14. By calling `applySafari14IDBFix()`, you can safely use IndexedDB in your application without worrying about the Safari 14 bug.
const { applySafari14IDBFix } = require('safari-14-idb-fix');
applySafari14IDBFix();
// Now you can safely use IndexedDB in Safari 14
const request = indexedDB.open('my-database');
request.onsuccess = function(event) {
const db = event.target.result;
// Perform database operations
};
The idb package is a well-known wrapper for IndexedDB that simplifies its usage with a promise-based API. While it does not specifically address the Safari 14 bug, it provides a more user-friendly interface for working with IndexedDB.
Dexie is a powerful wrapper for IndexedDB that offers a rich set of features, including a promise-based API, easy-to-use queries, and support for transactions. Like idb, it does not specifically target the Safari 14 bug but enhances the overall experience of working with IndexedDB.
LocalForage is a library that provides a simple API for storing data in various storage backends, including IndexedDB, WebSQL, and localStorage. It abstracts away the complexities of these storage mechanisms and offers a unified interface. While it does not specifically address the Safari 14 bug, it provides a versatile solution for client-side storage.
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.
});
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.FAQs
Working around a Safari 14 IndexedDB bug
The npm package safari-14-idb-fix receives a total of 112,421 weekly downloads. As such, safari-14-idb-fix popularity was classified as popular.
We found that safari-14-idb-fix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.