MCPcopy Create free account
hub / github.com/chhoumann/quickadd / getOwnerDocument

Function getOwnerDocument

src/utils/activeWindow.ts:1–10  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

1export function getOwnerDocument(node: Node): Document {
2 if (node.nodeType === Node.DOCUMENT_NODE) {
3 return node as Document;
4 }
5 const ownerDocument = node.ownerDocument;
6 if (!ownerDocument) {
7 throw new Error("Unable to resolve owner document for DOM node.");
8 }
9 return ownerDocument;
10}
11
12export function getOwnerWindow(node: Node): Window {
13 const ownerWindow = getOwnerDocument(node).defaultView;

Callers 9

getFocusedPropertyTargetFunction · 0.90
openFunction · 0.90
closeFunction · 0.90
openMethod · 0.90
hideTooltipMethod · 0.90
addHoverTooltipMethod · 0.90
getOwnerWindowFunction · 0.70
createOwnedElementFunction · 0.70
createOwnedTextNodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected