MCPcopy Create free account
hub / github.com/zxlie/FeHelper / addCandidate

Function addCandidate

apps/json-format/content-script.js:1201–1207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1199 let candidates = [];
1200 let seen = new Set();
1201 let addCandidate = text => {
1202 text = (text || '').trim();
1203 if (text && !seen.has(text)) {
1204 seen.add(text);
1205 candidates.push(text);
1206 }
1207 };
1208 let isVisibleElement = elm => elm && elm.nodeType === Node.ELEMENT_NODE && (elm.offsetHeight + elm.offsetWidth !== 0);
1209
1210 addCandidate(dom && dom.textContent);

Callers 1

_getJsonContentFromDOMFunction · 0.70

Calls 2

hasMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected