MCPcopy
hub / github.com/xcanwin/KeepChatGPT / scanPrompt

Function scanPrompt

KeepChatGPT.user.js:2782–2803  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 6

$Function · 0.85
sanitizeDataSecTextFunction · 0.85
gvFunction · 0.85
setPromptPlainTextFunction · 0.85
ndialogFunction · 0.85
tlFunction · 0.85

Tested by

no test coverage detected