mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 10:39:57 +00:00
Only import ShimManager into shim/export.ts if run from background
This commit is contained in:
@@ -9,8 +9,6 @@ import { onMessage
|
|||||||
, onMessageResponse
|
, onMessageResponse
|
||||||
, sendMessage } from "./eventMessageChannel";
|
, sendMessage } from "./eventMessageChannel";
|
||||||
|
|
||||||
import ShimManager from "../background/ShimManager";
|
|
||||||
|
|
||||||
|
|
||||||
let initializedBridgeInfo: BridgeInfo;
|
let initializedBridgeInfo: BridgeInfo;
|
||||||
let initializedBackgroundPort: MessagePort;
|
let initializedBackgroundPort: MessagePort;
|
||||||
@@ -46,6 +44,9 @@ export function ensureInit (): Promise<MessagePort> {
|
|||||||
* URL.
|
* URL.
|
||||||
*/
|
*/
|
||||||
if (window.location.protocol === "moz-extension:") {
|
if (window.location.protocol === "moz-extension:") {
|
||||||
|
const { default: ShimManager } =
|
||||||
|
await import("../background/ShimManager");
|
||||||
|
|
||||||
// port2 will post bridge messages to port 1
|
// port2 will post bridge messages to port 1
|
||||||
await ShimManager.init();
|
await ShimManager.init();
|
||||||
await ShimManager.createShim(channel.port2);
|
await ShimManager.createShim(channel.port2);
|
||||||
|
|||||||
Reference in New Issue
Block a user