🏠

Greasy Fork is available in English.

Faster IndexedDB Geter

A library that can make you do the things of IndexedDB faster.

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.org/scripts/478225/1270031/Faster%20IndexedDB%20Geter.js

提问、发表评价,或者 举报这个脚本
// ==UserScript==
// ==UserLibrary==
// @name        Faster IndexedDB Geter
// @grant       unsafeWindow
// @version     0.0
// @description A library that can make you do the things of IndexedDB faster.
// @author      PPPxcy
// @include     *
// @namespace   PPPScript
// ==/UserLibrary==
// ==/UserScript==
unsafeWindow.ReadIndexedDB = function ReadIndexedDB(storeName, groupName, keyName) {
return new Promise((rsl, rej) => {try {
(r => r.onsuccess = () => (t => t.onsuccess = () => rsl(t.result))(r.result.transaction([groupName], 'readonly').objectStore(groupName).get(keyName)))(unsafeWindow.indexedDB.open(storeName));
} catch(err) { rej(err); }});
};