From 9e3db0c63aa24ae9f345f2c8766695c353643775 Mon Sep 17 00:00:00 2001 From: adrianmarinwork Date: Tue, 6 Dec 2022 16:34:50 +0100 Subject: [PATCH] fix: code removes all "copy code" btns not only first one --- src/content_script.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/content_script.js b/src/content_script.js index c7aacff..c65a904 100644 --- a/src/content_script.js +++ b/src/content_script.js @@ -84,7 +84,12 @@ function downloadThread({ as = Format.PNG } = {}) { } //Delete copy button from code blocks - cloneDoc.querySelector('button.flex').remove(); + let listOfCopyBtns = cloneDoc.querySelectorAll('button.flex'); + + for (let i = 0, leng = listOfCopyBtns.length; i < leng; i++) { + let button = listOfCopyBtns[i]; + button.remove(); + } } } ).then(async function (canvas) {