From 28e8ed4a6068aea8adf737f57cb5fd15a434f998 Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Sun, 2 Apr 2023 22:29:39 +0100 Subject: [PATCH] inject: dom optimizer (wip) --- src/mainWindow.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mainWindow.js b/src/mainWindow.js index 48b3982..95db72a 100644 --- a/src/mainWindow.js +++ b/src/mainWindow.js @@ -66,4 +66,13 @@ setInterval(() => { // Try init themesync themesync(); } catch (e) { } }, 10000); -themesync(); \ No newline at end of file +themesync(); + +// DOM Optimizer - see docs (todo) +const removeOrig = Element.prototype.removeChild; +Element.prototype.removeChild = function(...args) { + if (typeof args[0].className === 'string' && (args[0].className.indexOf('activity') !== -1)) + return setTimeout(() => removeOrig.apply(this, args), 100); + + return removeOrig.apply(this, args); +}; \ No newline at end of file