popup: Improve owner visibility detection algorithm (close #290)

@narqo @veged take a look