()
| 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 = {}; |
no test coverage detected