Setup: Let $S$ be a set. Let $B$ be a Boolean subalgebra of $\{0,1\}^S$; i.e., just to be clear $B$ contains the constant $0$ and $1$ functions, and is stable under binary pointwise $\land$, $\lor$ and pointwise $\neg$.
We endow $\{0,1\}^S$ with the product topology, and $B$ with the subspace topology it inherits from this.
This gives us a continuous map $\beta B \to \{0,1\}^S$, where $\beta B$ is the Stone-Čech compactification of $B$ (as a topological space).
It is easy to describe when this map $\beta B \to \{0,1\}^S$ is surjective: this occurs exactly when ($B$ is dense in $\{0,1\}^S$, i.e. when) for every $x_1,\ldots,x_n \in S$ distinct and every $v_1,\ldots,v_n \in \{0,1\}$ there exists $h\in B$ such that $h(x_i) = v_i$ for all $i$. Let us assume this.
QUESTION: Can we give a simple criterion for the map $\beta B \to \{0,1\}^S$ to be injective (i.e., to be a homeomorphism)?
I am aware that this means that $B$ is $C^*$-embedded in $\{0,1\}^S$ (i.e., every continuous function $B \to \mathbb{R}$ extends to $\{0,1\}^S$), but I am hoping for a more useful criterion for the rather special setup at hand. The condition implies (and is possibly equivalent, I don't know) to “every clopen subset of $B$ is a finite Boolean combination of those of the form $\{h\in B : h(x) = 1\}$ for $x\in S$” (i.e., every continuous function $B \to \{0,1\}$ extends to $\{0,1\}^S$), but this is still not very manageable because I don't see how to get a handle on $\operatorname{Clop}(B)$, so I am hoping for a more easily testable condition.
Failing an exact necessary and sufficient condition, I would be interested in interesting examples where the map is or is not injective (I have none!), or conditions that are either necessary and sufficient.
The specific example which motivated this question is when $S = \mathbb{R}$ and $B$ is generated by characteristic functions of intervals with rational endpoints, but I already asked this on MSE (with no answer so far), so here I am trying to generalize the problem in the hope that it will be more interesting.