Sniffing IndexedDB
_Generated by ChatGPT on 2024-10-18_ ``` (function() { // Hook into IndexedDB.open() const originalOpen = indexedDB.open; indexedDB.open = function(name, version) { console.log(`IndexedDB.open() called with name: ${name}, version: ${version}`); const request = originalOpen.apply(this, arguments); request.onsuccess = function(event) { console.log('Database opened successfully:', request.result); }; request.onerror = function(event) { console.error('Error opening database:', request.error); }; return request; }; // Hook into IDBDatabase.transaction() const originalTransaction = IDBDatabase.prototype.transaction; IDBDatabase.prototype.transaction = function(storeNames, mode) { console.log(`IDBDatabase.transaction() called with storeNames: ${storeNames}, mode: ${mode}`); return originalTransaction.apply(this, arguments); }; // Hook into IDBObjectStore.get() const originalGet = IDBObjectStore.prototype.get; IDBObjectStore.prototype.get = function(key) { console.log(`IDBObjectStore.get() called with key: ${key}`); return originalGet.apply(this, arguments); }; // Hook into IDBObjectStore.put() const originalPut = IDBObjectStore.prototype.put; IDBObjectStore.prototype.put = function(value, key) { console.log(`IDBObjectStore.put() called with value:`, value, `key:`, key); return originalPut.apply(this, arguments); }; // Hook into IDBObjectStore.add() const originalAdd = IDBObjectStore.prototype.add; IDBObjectStore.prototype.add = function(value, key) { console.log(`IDBObjectStore.add() called with value:`, value, `key:`, key); return originalAdd.apply(this, arguments); }; // Hook into IDBObjectStore.delete() const originalDelete = IDBObjectStore.prototype.delete; IDBObjectStore.prototype.delete = function(key) { console.log(`IDBObjectStore.delete() called with key: ${key}`); return originalDelete.apply(this, arguments); }; console.log('IndexedDB hooks injected.'); })(); ```Created: 2024-10-17 12:21:34, Updated: 2024-10-17 12:21:34, ID: 1e94bba7-2f2a-4c11-9b9d-87abf5af47e3