MCPcopy
hub / github.com/Bistutu/FluentRead / processNode

Function processNode

userscripts.js:1902–1925  ·  view source on GitHub ↗
(node, attr, respMap)

Source from the content-addressed store, hash-verified

1900}
1901
1902function processNode(node, attr, respMap) {
1903 let text;
1904 switch (attr) {
1905 case textType.textContent:
1906 text = node.textContent;
1907 break;
1908 case textType.placeholder:
1909 text = node.placeholder;
1910 break;
1911 case textType.inputValue:
1912 text = node.value;
1913 break;
1914 case textType.ariaLabel:
1915 text = node.getAttribute('aria-label');
1916 break;
1917 }
1918
1919 if (pruneSet.has(text)) return;
1920
1921 let formattedText = format(text);
1922 if (formattedText && withoutChinese(formattedText)) {
1923 signature(url.host + formattedText).then(sign => respMap[sign] ? replaceText(attr, node, respMap[sign]) : null)
1924 }
1925}
1926
1927// endregion
1928

Callers 5

parseDfsFunction · 0.85
procCozeFunction · 0.85
procOpenaiFunction · 0.85
procMavenFunction · 0.85
procDockerhubFunction · 0.85

Calls 4

formatFunction · 0.85
withoutChineseFunction · 0.85
signatureFunction · 0.85
replaceTextFunction · 0.85

Tested by

no test coverage detected