diff --git a/better-xcloud.user.js b/better-xcloud.user.js index eb52f49..4d96d21 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -8241,17 +8241,38 @@ function updateIceCandidates(candidates, options) { } +function clearDbLogs(dbName, table) { + const request = window.indexedDB.open(dbName); + request.onsuccess = e => { + const db = e.target.result; + + const objectStore = db.transaction(table, 'readwrite').objectStore(table); + const objectStoreRequest = objectStore.clear(); + + objectStoreRequest.onsuccess = function(event) { + console.log(`[Better xCloud] Cleared ${dbName}.${table}`); + }; + } +} + function clearApplicationInsightsBuffers() { window.sessionStorage.removeItem('AI_buffer'); window.sessionStorage.removeItem('AI_sentBuffer'); } +function clearAllLogs() { + clearApplicationInsightsBuffers(); + clearDbLogs('StreamClientLogHandler', 'logs'); + clearDbLogs('XCloudAppLogs', 'logs'); +} + + function interceptHttpRequests() { var BLOCKED_URLS = []; if (PREFS.get(Preferences.BLOCK_TRACKING)) { // Clear Applications Insight buffers - clearApplicationInsightsBuffers(); + clearAllLogs(); BLOCKED_URLS = BLOCKED_URLS.concat([ 'https://arc.msn.com', @@ -8283,7 +8304,7 @@ function interceptHttpRequests() { for (let blocked of BLOCKED_URLS) { if (this._url.startsWith(blocked)) { if (blocked === 'https://dc.services.visualstudio.com') { - setTimeout(clearApplicationInsightsBuffers, 1000); + setTimeout(clearAllLogs, 1000); } return false; }