Clean up shim initialization

This commit is contained in:
hensm
2019-06-19 01:39:19 +01:00
parent 290a1facdb
commit 0a9af09419
13 changed files with 66 additions and 88 deletions

View File

@@ -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();