MCPcopy Index your code
hub / github.com/Bistutu/FluentRead / getInputBoxText

Function getInputBoxText

entrypoints/content.ts:764–774  ·  view source on GitHub ↗

* 获取输入框中的文本

(element: HTMLElement)

Source from the content-addressed store, hash-verified

762 * 获取输入框中的文本
763 */
764function getInputBoxText(element: HTMLElement): string {
765 const tagName = element.tagName.toLowerCase();
766
767 if (tagName === 'input' || tagName === 'textarea') {
768 return (element as HTMLInputElement | HTMLTextAreaElement).value.trim();
769 } else if (element.contentEditable === 'true') {
770 return element.innerText.trim();
771 }
772
773 return '';
774}
775
776/**
777 * 根据触发方式去除末尾的触发符号

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected