MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / init

Function init

src/background/utils/patch-db.js:8–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6 console.info('Upgrade database...');
7 init();
8 function init() {
9 const req = indexedDB.open(VIOLENTMONKEY, 1);
10 req.onsuccess = () => {
11 try {
12 transform(req.result);
13 } catch (err) {
14 // This should not happen, but did happen in Firefox.
15 reject(err);
16 }
17 };
18 req.onerror = reject;
19 req.onupgradeneeded = () => {
20 // No available upgradation
21 reject();
22 };
23 }
24 function transform(db) {
25 const tx = db.transaction([SCRIPTS, S_REQUIRE, S_CACHE, VALUES]);
26 const updates = {};

Callers 2

doFetchFunction · 0.70
patch-db.jsFile · 0.70

Calls 1

transformFunction · 0.85

Tested by

no test coverage detected