Let $X$ be a normal affine algebraic variety of dimension $n$ and ${\bar X}^1$, ${\bar X}^2$ be complete normal varieties containing $X$ as a (Zariski) dense open subset. Let $f$ be a regular function on $X$ such that $f$ has a pole along every irreducible component (which is necessarily of dimension $n-1$) of $\bar X^i \setminus X$ for each $i$, $1 \leq i \leq 2$. Let $\bar X \subseteq {\bar X}^1 \times {\bar X}^2$ be the closure of the diagonal embedding of $X$ into ${\bar X}^1 \times {\bar X}^2$. Is it true (assuming that $\bar X$ is also normal) that $f$ has a pole along every irreducible component of $\bar X\setminus X$?
It is easy to see that this is true when $n=2$ or when $X$ is a (Zariski) open subset of a torus $\mathbb T$ and ${\bar X}^i$'s are toric completions of $\mathbb T$. But the general case still eludes me.