()
| 2780 | |
| 2781 | dataSec.listen_input = function (event) { |
| 2782 | const scanPrompt = function () { |
| 2783 | const promptTextarea = $("form.w-full #prompt-textarea"); |
| 2784 | if (!promptTextarea) return; |
| 2785 | |
| 2786 | const result = sanitizeDataSecText( |
| 2787 | "value" in promptTextarea |
| 2788 | ? promptTextarea.value |
| 2789 | : promptTextarea.innerText || promptTextarea.textContent, |
| 2790 | gv("k_datasecblocklist", datasec_blocklist_default), |
| 2791 | ); |
| 2792 | if (!result.matches.join(`\n`).trim()) return; |
| 2793 | |
| 2794 | setPromptPlainText(promptTextarea, result.text); |
| 2795 | ndialog( |
| 2796 | `⚠️${tl("警告")}`, |
| 2797 | `${tl("发现敏感数据")}`, |
| 2798 | `Thanks`, |
| 2799 | function (t) {}, |
| 2800 | `textarea`, |
| 2801 | result.matches.join(`\n`), |
| 2802 | ); |
| 2803 | }; |
| 2804 | event?.type === "paste" ? setTimeout(scanPrompt, 0) : scanPrompt(); |
| 2805 | }; |
| 2806 |
no test coverage detected