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

Function stubContentWindow

packages/player/src/hyperframes-player.test.ts:959–967  ·  view source on GitHub ↗
(stub: FakeContentWindow | "throw")

Source from the content-addressed store, hash-verified

957 // sync path sees. Passing `"throw"` simulates the cross-origin SecurityError
958 // a real browser raises when reading `contentWindow.<anything>`.
959 function stubContentWindow(stub: FakeContentWindow | "throw") {
960 Object.defineProperty(player.iframe, "contentWindow", {
961 configurable: true,
962 get() {
963 if (stub === "throw") throw new Error("SecurityError");
964 return stub;
965 },
966 });
967 }
968
969 it("calls __player.seek directly on the same-origin path", () => {
970 // The whole point of P3-1: when the runtime is reachable, scrubs land in

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected