It's funny how Facebook used a similar technique in the past,
Imagine you opened facebook.com, scrolled through your feed for a bit and then decided to open a new tab to read some news. Even though there were updates on your Facebook feed while you were away, they wouldn't display until you clicked back on the Facebook tab. Only when you switched tabs would it trigger the event to fetch the latest feed updates.
Do you know how this was achieved?