From af6e9a8153c24d0400592005b31d56fecff67068 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 30 Jan 2021 11:15:11 -0500 Subject: Fix CSP error when reading images from the clipboard using the paste command (#1328) --- ext/bg/js/clipboard-reader.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/bg') diff --git a/ext/bg/js/clipboard-reader.js b/ext/bg/js/clipboard-reader.js index 4fcb480e..8065cb16 100644 --- a/ext/bg/js/clipboard-reader.js +++ b/ext/bg/js/clipboard-reader.js @@ -134,6 +134,9 @@ class ClipboardReader { document.execCommand('paste'); const image = target.querySelector('img[src^="data:"]'); const result = (image !== null ? image.getAttribute('src') : null); + for (const image2 of target.querySelectorAll('img')) { + image2.removeAttribute('src'); + } target.textContent = ''; return result; } -- cgit v1.2.3