"use strict"; import * as cast from "./cast"; import { CAST_FRAMEWORK_SCRIPT_URL } from "../lib/endpoints"; import { loadScript } from "../lib/utils"; import { onMessage } from "./eventMessageChannel"; const _window = (window as any); if (!_window.chrome) { _window.chrome = {}; } // Remove private APIs delete cast._requestSession; // Create page-accessible API object _window.chrome.cast = cast; let bridgeInfo: any; let isFramework = false; // Call page's API loaded function if defined function callPageReadyFunction () { const readyFunction = _window.__onGCastApiAvailable; if (readyFunction && typeof readyFunction === "function") { readyFunction(bridgeInfo && bridgeInfo.isVersionCompatible); } } /** * If loaded within a page via a