Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/websocket_broadcastchannel/mod.ts>polyfillBroadcastChannel

Host-wide BroadcastChannel for Deno CLI, backed by WebSockets.
Latest
function polyfillBroadcastChannel
import { polyfillBroadcastChannel } from "https://deno.land/x/websocket_broadcastchannel@0.8.0/mod.ts";

Polyfills the globalThis with a BroadcastChannel implementation, if one is not already present.

Parameters

optional
g = [UNSUPPORTED]

The globalThis to polyfill. Defaults to the globalThis in the current context.

Returns

The globalThis that was passed in, type-cast so TypeScript can see it has "BroadcastChannel".