mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 10:39:57 +00:00
Clean up shim initialization
This commit is contained in:
@@ -4,7 +4,7 @@ import * as cast from "./cast";
|
||||
|
||||
import { CAST_FRAMEWORK_SCRIPT_URL } from "../endpoints";
|
||||
import { loadScript } from "../lib/utils";
|
||||
import { onMessage } from "./messageBridge";
|
||||
import { onMessage } from "./eventMessageChannel";
|
||||
|
||||
|
||||
const _window = (window as any);
|
||||
@@ -47,6 +47,12 @@ if (document.currentScript) {
|
||||
|
||||
isFramework = true;
|
||||
|
||||
/**
|
||||
* Framework API library requires webcomponents for the cast
|
||||
* button custom element (<google-cast-launcher>).
|
||||
*/
|
||||
loadScript(browser.runtime.getURL("vendor/webcomponents-lite.js"));
|
||||
|
||||
const script = loadScript(CAST_FRAMEWORK_SCRIPT_URL);
|
||||
script.addEventListener("load", ev => {
|
||||
callPageReadyFunction();
|
||||
|
||||
Reference in New Issue
Block a user