mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-13 02:49:58 +00:00
Move endpoints module from lib/ to cast/
This commit is contained in:
@@ -8,7 +8,7 @@ import { getChromeUserAgent } from "../lib/userAgents";
|
|||||||
import {
|
import {
|
||||||
CAST_FRAMEWORK_LOADER_SCRIPT_URL,
|
CAST_FRAMEWORK_LOADER_SCRIPT_URL,
|
||||||
CAST_LOADER_SCRIPT_URL
|
CAST_LOADER_SCRIPT_URL
|
||||||
} from "../lib/endpoints";
|
} from "../cast/endpoints";
|
||||||
|
|
||||||
// Missing on @types/firefox-webext-browser
|
// Missing on @types/firefox-webext-browser
|
||||||
type OnBeforeSendHeadersDetails = Parameters<
|
type OnBeforeSendHeadersDetails = Parameters<
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { CAST_LOADER_SCRIPT_URL, CAST_SCRIPT_URLS } from "../lib/endpoints";
|
import { CAST_LOADER_SCRIPT_URL, CAST_SCRIPT_URLS } from "./endpoints";
|
||||||
|
|
||||||
const _window = window.wrappedJSObject as any;
|
const _window = window.wrappedJSObject as any;
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import * as cast from "./api";
|
import * as cast from "./api";
|
||||||
import logger from "../lib/logger";
|
import logger from "../lib/logger";
|
||||||
|
|
||||||
import { CAST_FRAMEWORK_SCRIPT_URL } from "../lib/endpoints";
|
|
||||||
import { loadScript } from "../lib/utils";
|
import { loadScript } from "../lib/utils";
|
||||||
|
import { CAST_FRAMEWORK_SCRIPT_URL } from "./endpoints";
|
||||||
import { onMessage } from "./eventMessageChannel";
|
import { onMessage } from "./eventMessageChannel";
|
||||||
|
|
||||||
const _window = window as any;
|
const _window = window as any;
|
||||||
@@ -36,10 +36,10 @@ if (document.currentScript) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Queue up the framework script load to speed up init
|
// Queue up the framework script load to speed up init
|
||||||
frameworkScriptPromise = loadScript(CAST_FRAMEWORK_SCRIPT_URL);
|
frameworkScriptPromise = loadScript(CAST_FRAMEWORK_SCRIPT_URL);
|
||||||
frameworkScriptPromise.catch(() => {
|
frameworkScriptPromise.catch(() => {
|
||||||
logger.error("Failed to load CAF script!");
|
logger.error("Failed to load CAF script!");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ onMessage(async message => {
|
|||||||
if (frameworkScriptPromise) {
|
if (frameworkScriptPromise) {
|
||||||
await frameworkScriptPromise;
|
await frameworkScriptPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call page script/framework API script's init function
|
// Call page script/framework API script's init function
|
||||||
const initFn = _window.__onGCastApiAvailable;
|
const initFn = _window.__onGCastApiAvailable;
|
||||||
if (initFn && typeof initFn === "function") {
|
if (initFn && typeof initFn === "function") {
|
||||||
|
|||||||
Reference in New Issue
Block a user