Skip to content

Documentation / @etherfold/browser / STATE_MOVED_CHANNEL_PROTOCOL

Variable: STATE_MOVED_CHANNEL_PROTOCOL ​

const STATE_MOVED_CHANNEL_PROTOCOL: "etherfold/state-moved" = 'etherfold/state-moved'

Defined in: packages/browser/src/stateMovedAcrossTabs.ts:19

THE NAMESPACE THIS ADAPTER OWNS, used for BOTH halves of what it names: the BroadcastChannel's own name, and the envelope every message on it wears.

ONE constant because they are one decision. A channel name that did not say whose it was would collide with whatever else an origin broadcasts, and an envelope that did not say so would make a stranger's message on our channel indistinguishable from a notification -- which is the same rule the port envelope states for a worker scope, here for the same reason: a channel carries whatever anybody posts to it.