From 76f8c61b7c13e039c84bf16e28847dede63d8d80 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 31 Jan 2026 15:43:21 +0000 Subject: [PATCH] Optimize checkDOM iteration to avoid array allocation Replaced spread and map with for...of loop to iterate NodeList directly. Reduces memory allocation and improves iteration performance. Co-authored-by: NDevTK <31563761+NDevTK@users.noreply.github.com> --- ContentScript.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ContentScript.js b/ContentScript.js index 3d7c359..cce5628 100644 --- a/ContentScript.js +++ b/ContentScript.js @@ -326,14 +326,14 @@ function checkShadow(DOM = document) { } function checkDOM() { - [...document.querySelectorAll('*')].map((e) => { + for (const e of document.querySelectorAll('*')) { if (!isPaused(e)) { if (validMedia(e)) { addMedia(e); onPlay(e); } } - }); + } } function send(message, body = '') {