* 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)
| 441 | * patched data attached to them. |
| 442 | */ |
| 443 | function 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 |
no test coverage detected
searching dependent graphs…