diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-01-30 11:15:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-30 11:15:11 -0500 |
commit | af6e9a8153c24d0400592005b31d56fecff67068 (patch) | |
tree | 2f78c7eb3a7799574b58945697b0ef085c82ccfa | |
parent | 588d8a681a34da5777520096a11d5eea74fc2251 (diff) |
Fix CSP error when reading images from the clipboard using the paste command (#1328)
-rw-r--r-- | ext/bg/js/clipboard-reader.js | 3 |
1 files changed, 3 insertions, 0 deletions
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; } |