Firefox: fix copy from edit textarea

80f91d129e0e22c5a48b6171d8dd11dc7e87ab59

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -0Ignore whitespace
public/scripts/browser-fixes.js+4 -0
@@ -6,6 +6,10 @@ function sanitizeInlineQuotationOnCopy() {
66 // STRG+C, STRG+V on firefox leads to duplicate double quotes when inline quotation elements are copied.
77 // To work around this, take the selection and transform <q> to <span> before calling toString().
88 document.addEventListener('copy', function (event) {
9+ if (document.activeElement instanceof HTMLInputElement || document.activeElement instanceof HTMLTextAreaElement) {
10+ return;
11+ }
12+
913 const selection = window.getSelection();
1014 if (!selection.anchorNode?.parentElement.closest('.mes_text')) {
1115 return;