MCPcopy
hub / github.com/bubkoo/html-to-image / cloneIFrameElement

Function cloneIFrameElement

src/clone-node.ts:37–51  ·  view source on GitHub ↗
(iframe: HTMLIFrameElement, options: Options)

Source from the content-addressed store, hash-verified

35}
36
37async function cloneIFrameElement(iframe: HTMLIFrameElement, options: Options) {
38 try {
39 if (iframe?.contentDocument?.body) {
40 return (await cloneNode(
41 iframe.contentDocument.body,
42 options,
43 true,
44 )) as HTMLBodyElement
45 }
46 } catch {
47 // Failed to clone iframe
48 }
49
50 return iframe.cloneNode(false) as HTMLIFrameElement
51}
52
53async function cloneSingleNode<T extends HTMLElement>(
54 node: T,

Callers 1

cloneSingleNodeFunction · 0.85

Calls 1

cloneNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…