MCPcopy Index your code
hub / github.com/angular/angular / isLikelyExternalSourceNode

Function isLikelyExternalSourceNode

packages/core/src/hydration/error_handling.ts:443–455  ·  view source on GitHub ↗

* Checks if a given RNode is likely to have been added by a third-party script * or browser extension, by checking whether Angular has any knowledge of it * via patched data. Nodes created and managed by Angular will always have * patched data attached to them.

(rNode: RNode)

Source from the content-addressed store, hash-verified

441 * patched data attached to them.
442 */
443function isLikelyExternalSourceNode(rNode: RNode): boolean {
444 const node = rNode as Node;
445 if (node.nodeType !== Node.ELEMENT_NODE) {
446 return false;
447 }
448 // If Angular has patched this node, it was created within Angular's context.
449 if (readPatchedData(node as HTMLElement)) {
450 return false;
451 }
452 // No patched data means Angular has no record of this node —
453 // it was likely injected by a third-party script or browser extension.
454 return true;
455}
456
457/**
458 * An attribute related note for hydration errors

Callers 1

validateMatchingNodeFunction · 0.85

Calls 1

readPatchedDataFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…