mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 08:07:18 +02:00
Clear logs in DB
This commit is contained in:
parent
281787d955
commit
989634b52e
@ -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() {
|
function clearApplicationInsightsBuffers() {
|
||||||
window.sessionStorage.removeItem('AI_buffer');
|
window.sessionStorage.removeItem('AI_buffer');
|
||||||
window.sessionStorage.removeItem('AI_sentBuffer');
|
window.sessionStorage.removeItem('AI_sentBuffer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function clearAllLogs() {
|
||||||
|
clearApplicationInsightsBuffers();
|
||||||
|
clearDbLogs('StreamClientLogHandler', 'logs');
|
||||||
|
clearDbLogs('XCloudAppLogs', 'logs');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function interceptHttpRequests() {
|
function interceptHttpRequests() {
|
||||||
var BLOCKED_URLS = [];
|
var BLOCKED_URLS = [];
|
||||||
if (PREFS.get(Preferences.BLOCK_TRACKING)) {
|
if (PREFS.get(Preferences.BLOCK_TRACKING)) {
|
||||||
// Clear Applications Insight buffers
|
// Clear Applications Insight buffers
|
||||||
clearApplicationInsightsBuffers();
|
clearAllLogs();
|
||||||
|
|
||||||
BLOCKED_URLS = BLOCKED_URLS.concat([
|
BLOCKED_URLS = BLOCKED_URLS.concat([
|
||||||
'https://arc.msn.com',
|
'https://arc.msn.com',
|
||||||
@ -8283,7 +8304,7 @@ function interceptHttpRequests() {
|
|||||||
for (let blocked of BLOCKED_URLS) {
|
for (let blocked of BLOCKED_URLS) {
|
||||||
if (this._url.startsWith(blocked)) {
|
if (this._url.startsWith(blocked)) {
|
||||||
if (blocked === 'https://dc.services.visualstudio.com') {
|
if (blocked === 'https://dc.services.visualstudio.com') {
|
||||||
setTimeout(clearApplicationInsightsBuffers, 1000);
|
setTimeout(clearAllLogs, 1000);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user