MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / findGsapScriptElement

Function findGsapScriptElement

packages/sdk/src/engine/model.ts:312–320  ·  view source on GitHub ↗
(document: Document)

Source from the content-addressed store, hash-verified

310// ─── GSAP script helpers ──────────────────────────────────────────────────────
311
312function findGsapScriptElement(document: Document): Element | null {
313 const scripts = document.querySelectorAll("script");
314 for (const script of Array.from(scripts)) {
315 const text = script.textContent ?? "";
316 if (text.includes("gsap") || text.includes("ScrollTrigger"))
317 return script as unknown as Element;
318 }
319 return null;
320}
321
322export function getGsapScript(document: Document): string | null {
323 const el = findGsapScriptElement(document);

Callers 2

getGsapScriptFunction · 0.85
setGsapScriptFunction · 0.85

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected