Precise DOM morphing
morphing typescript dom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Match by huristics

+27
+27
src/morphlex.ts
··· 327 327 } 328 328 } 329 329 330 + // Match by huristics 331 + for (const node of unmatched) { 332 + if (!isElement(node)) continue 333 + const className = node.className 334 + const name = node.getAttribute("name") 335 + const ariaLabel = node.getAttribute("aria-label") 336 + const ariaDescription = node.getAttribute("aria-description") 337 + const href = node.getAttribute("href") 338 + 339 + for (const candidate of candidates) { 340 + if ( 341 + isElement(candidate) && 342 + node.localName === candidate.localName && 343 + ((className !== "" && className === candidate.className) || 344 + (name !== "" && name === candidate.getAttribute("name")) || 345 + (ariaLabel !== "" && ariaLabel === candidate.getAttribute("aria-label")) || 346 + (ariaDescription !== "" && ariaDescription === candidate.getAttribute("aria-description")) || 347 + (href !== "" && href === candidate.getAttribute("href"))) 348 + ) { 349 + matches.set(node, candidate) 350 + unmatched.delete(node) 351 + candidates.delete(candidate) 352 + break 353 + } 354 + } 355 + } 356 + 330 357 // Match by nodeType 331 358 for (const node of unmatched) { 332 359 const nodeType = node.nodeType