mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-11 18:19:58 +00:00
Add webcomponents polyfill and load official framework API script
This commit is contained in:
@@ -3,6 +3,15 @@
|
||||
import { Message } from "../types";
|
||||
import { onMessageResponse, sendMessage } from "./messageBridge";
|
||||
|
||||
|
||||
if ((window as any)._isFramework) {
|
||||
const polyfillScriptElement = document.createElement("script");
|
||||
polyfillScriptElement.src = browser.runtime.getURL(
|
||||
"vendor/webcomponents-lite.js")
|
||||
document.head.append(polyfillScriptElement);
|
||||
}
|
||||
|
||||
|
||||
// Message ports
|
||||
const backgroundPort = browser.runtime.connect({ name: "shim" });
|
||||
let popupPort: browser.runtime.Port;
|
||||
|
||||
Reference in New Issue
Block a user